Java:
Outline: The main program will read in a group of three integer values which represent a student's SAT scores. The main program will call a method to determine if these three scores are all valid--valid means in the range from 200 to 800, including both end points, and is a multiple of 10 (ends in a 0).
If the scores are all valid, the main program will call a method (which will itself call other methods) to classify the group of three scores in various ways. The main program will repeat this process for the entire set of data, then print some counters.
Main Program:
The main program will read in and print three integer values, representing SAT scores.
Then the main program will call the method isitavalidgroup() to determine whether or not this group is valid. In either case, the main program will print the result of the method call (and add to the appropriate counter – discussed below).
In more detail: If the method isitavalidgroup() says this is a valid group, the main program will print a message, add to the counter of valid groups, and call the method classify().
However, if isitavalidgroup() says the group is not valid, the main program will print a message, add to the counter of invalid groups, and go back to read the next group.
(And somewhere add to the counter of total groups.)
The main program will continue this process for the entire set of data. When the main program runs out of groups of three values (you must decide when this occurs), print the final values of three counters: the total number of groups processed, how many groups were valid, and how many groups were invalid.
Use three separate counters. Do not compute one from the others.
Methods:
1. Write a method isitavalidgroup() which will receive three parameters. For each parameter value which is invalid (invalid means less than 200 or more than 800 or not a multiple of 10), the method will print the invalid value. The method will return true if all three values are in the range from 200 to 800 and a multiple of 10; otherwise it will return false.
2. Write a method classify() which will receive three parameters (at this point, they must be valid values). This method will call the two methods described below, as follows.
Using the method ratesonescore(), classify() will rate each of the three scores, one at a time. There will be three calls to this method, one for each score.
Then classify() will use the method findtotalscore() to find the total of the three scores.
Then classify() will use the method ratethegroup() to rate the three scores and the total together. Finally, classify() will return to the main program.
3. Write a method rateonescore() which will receive one parameter representing a valid SAT score. The method will determine which of the following three categories the score is in: less than 500, equal or more than 500 but less than 800, or 800 (perfect score). Note this method gets one parameter.
4. Write a method findtotalscore() which will receive three parameters, representing the three scores. The method will determine the total score, which is simply the sum of the three scores. The method will return the total score. (Somewhere it should be printed.)
5. Write a method ratethegroup() which will receive four parameters: the three scores and their total. The method will determine the group status, as follows:
If the total score is 2100 or above, and the score on each part is 700 or above, the group status is "outstanding";
if the total score is 2100 or above, and exactly two of the individual scores are 700 or above, the group status is "very good";
if the total score is 2100 or above, and exactly one individual score is 700 or above, the group status is "lop-sided";
NOTE: the three conditions above should all be grouped by total is 2100 or above
if the total score is less than 2100, and no individual score is 500 or above, the group status is "weak";
otherwise (if no condition described above is true), the group status is "erratic".
In all cases, the method will print the group status.
DATA: You will be judged on the quality of your data. Include at least 25 groups, but not necessarily 25! (Your program doesn’t know beforehand how many groups it will process) Include at least 6 invalid groups (spread them through the entire set of data), two with just one invalid, two groups with two invalids, and two with all three invalids. Also have some in the correct range but not multiple of 10. Have some values below 200, some at 200, some at 800, some above 800, and some exactly 500.
For the valid groups (have at least 18-20), make sure that the ratethegroup() method prints each possible status every way that status can occur. Be sure the validset() method tests each boundary value (199, 200, 201, 799, 800, and 801) at least once.
For the first 3 sets of data use the following:
200 400 600
550 800 650
150 660 455
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 5 images
- No written by hand solution Java Please Define stubs for the methods called by the below main(). Each stub should print "FIXME: Finish methodName()" followed by a newline, and should return -1. Example output: FIXME: Finish getUserNum() FIXME: Finish getUserNum() FIXME: Finish computeAvg() Avg: -1 import java.util.Scanner; public class MthdStubsStatistics { //solution here public static void main(String [] args) { int userNum1; int userNum2; int avgResult; userNum1 = getUserNum(); userNum2 = getUserNum(); avgResult = computeAvg(userNum1, userNum2); System.out.println("Avg: " + avgResult); } }arrow_forwardPlease help me! I have a lot of mini problems. I'm not sure how to start After #6, I have other problems. Those are : 7.) Write a method that reads a one-line sentence as input and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters, display the word Yes. If the sentence ends with a question mark and the input contains an odd number of characters, display the word No. If the sentence ends with an exclamation point (!), display the word Wow. In all other cases, display the words You always say followed by the input string enclosed in quotes. Your output should all be on one line. Be sure to note that in the last case, your output must include quotation marks around the echoed input string. In all other cases, there are no quotes in the output. Your program does not have to check the input to see that the user has entered a legitimate sentence. Notes: This code requires a three-way selection statement and…arrow_forwardJava int[] numbers = {345, 632, 675, 157, 834, 294, 832};1. Write a method to find its highest value. 2. Write a method to find its lowest value. 3. Write a method to find its total value.arrow_forward
- Instructor note: This lab is part of the assignment for this chapter. HINT: 1). The decision means how many times to flip the coin. 2). Use a random integer variable to indicate the head or tail in each toss. Java Define a method named coinFlip that takes a Random object and returns "Heads" or "Tails" according to a random value 1 or 0. Assume the value 1 represents "Heads" and 0 represents "Tails". Then, write a main program that reads the desired number of coin flips as an input, calls method coinFlip() repeatedly according to the number of coin flips, and outputs the results. Assume the input is a value greater than 0. Ex: If the random object is created with a seed value of 2 and the input is: 3 the output is: Heads Tails Heads Note: For testing purposes, a Random object is created in the main() method using a pseudo-random number generator with a fixed seed value. The program uses a seed value of 2 during development, but when submitted, a different seed value may be used…arrow_forwardJAVA PROGRAM Chapter 7. PC #1. Rainfall Class Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following: • the total rainfall for the year • the average monthly rainfall • the month with the most rain • the month with the least rain Demonstrate the class in a complete program. Main class name: RainFall (no package name) est Case 1 Enter the rainfall amount for month 1:\n1.2ENTEREnter the rainfall amount for month 2:\n2.3ENTEREnter the rainfall amount for month 3:\n3.4ENTEREnter the rainfall amount for month 4:\n5.1ENTEREnter the rainfall amount for month 5:\n1.7ENTEREnter the rainfall amount for month 6:\n6.5ENTEREnter the rainfall amount for month 7:\n2.5ENTEREnter the rainfall amount for month 8:\n3.3ENTEREnter the rainfall amount for month 9:\n1.1ENTEREnter the rainfall amount for month 10:\n5.5ENTEREnter the rainfall amount for month 11:\n6.6ENTEREnter…arrow_forwardFinancial Application:• Write a program that computes future investment value at a given interest rate for aspecified number of months and prints the report shown in the sample output. • Given the annual interest rate, the interest amount earned each month is computedusing the formula: Interest earned = investment amount * annual interest rate /1200 (=months * 100) • Write a method, computeFutureValue, which receives the investment amount, annualinterest rate and number of months as parameters and does the following: o Prints the interest amount earned each month and the new value of theinvestment (hint: use a loop). o Returns the total interest amount earned after the number of months specified bythe user. The main method will:o Ask the user for all input needed to call the computeFutureValue method.o Call computeFutureValueo Print the total interest amount earned by the investment at the end of thenumber of months entered by the user. Sample Program runningEnter the investment…arrow_forward
- 2. A pentagonal number is defined as n(3n-1)/2 for n = 1, 2, ..., etc.. Therefore, the first few numbers are 1, 5, 12, 22, ... . Write a method with the following header that returns a pentagonal number: %3D public static int getPentagonalNumber(int n) For example, getPentagonalNumber(1) returns 1 and getPentagonalNumber(2) returns 5. Write a test program that uses this method to display the first 100 pentagonal numbers with 10 numbers on each line. Numbers are separated by exactly one space.arrow_forwardJava programming The US dollar = 0.82 Euros and 1.21 Canadian dollars.Write the following methods to convert US dollars to Euros and to Canadiandollars: *** A method prompting the user to select an option (to convert to Euros orto Canadian dollars) and returns the option to the main method.arrow_forwardAlert dont submit AI generated answer. in Java.arrow_forward
- Program63.javaWrite a program that estimates the cost of carpet for one or more rooms with rectangular floors. Begin by prompting for the price of carpet per square yard and the number of rooms needing this carpet. Use a loop to prompt for the floor dimensions of each room in feet. In this loop, call a value-returning method with the dimensions and carpet price as arguments. The method should return the carpet cost for each room to main, where it will be printed and accumulated. After all rooms have been processed, the program should display the total cost of the job.Sample Output (image below) Program64.javaWrite a program that demonstrates method overloading by defining and calling methods that return the area of a triangle, a rectangle, or a square.arrow_forwardJava - Car Value (Classes)arrow_forwardJava code Calculate differencearrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY