Java program that prompts for the gpa

Assignment Help JAVA Programming
Reference no: EM13781401

This assignment will give you practice with interactive programs, if/else statements and methods that return values. Your program will prompt the user for information about two applicants and compute an overall score for each applicant. This is a simplified version of a program that might be used for admissions purposes.

Look at the sample log of execution to see how your program is to behave. For each applicant, we prompt for exam scores (either SAT or ACT) and overall GPA. The exam information is turned into a number between 0 and 100 and the GPA information is turned into a number between 0 and 100 and these two scores are added together to get an overall score between 0 and 200. After obtaining scores for each applicant, the program reports which one looks better or whether they look equal.

Notice that the program asks for each applicant whether to enter SAT scores or ACT scores (SAT scores are integers that vary between 200 and 800, ACT scores are integers that vary between 1 and 36). In the case of SAT scores, the user is prompted for SAT math, reading, and writing scores. In the case of ACT scores, the user is prompted for English, math, reading and science scores. These scores are turned into a real-valued number between 0 and 100 using the following formulas:

For SAT Scores:
For ACT Scores:

After computing this exam score, we compute a number between 0 and 100 based on the GPA. The program prompts for the GPA, the maximum GPA, and a transcript multiplier. All three of these are positive real values (i.e., they can have a decimal part). The transcript multiplier is a value between 0.8 and 1.0 that the admissions staff use to account for differences across students and across schools. For example, a student who takes more AP courses or a student who comes from a high school that is known to have tough grading standards will get a higher transcript multiplier. You should turn this into a score between 0 and 100 using the following formula:

At this point your program has two scores that vary from 0 to 100, one from test scores and one from GPA. The overall score for the applicant is computed as the sum of these two numbers (exam result + gparesult). Because each of these numbers is between 0 and 100, the overall score for an applicant ranges from 0 to 200.

As indicated in the sample log of execution, your program is to report the exam and GPA subscores and the overall score for each applicant. These should be rounded to one decimal place when displayed. You can do this using the round1 method described in lecture (see BMI2.java) or you can use the printf statement described in section 4.3 of the textbook. In addition to reporting the score for each applicant, the program should also produce whichever of the following messages is appropriate:

The first applicant seems to be better
The second applicant seems to be better
The two applicants seem to be equal

You do not have to perform any error checking. We will assume that the user enters numbers that are in the appropriate range. Even though your program is rounding numbers to one decimal place when they are displayed, it should not round the numbers that are used to compute results and to compare scores. This can lead to some confusing output. For example, if the exam subscore is 84.06 and the GPAsubscore is 62.78, then they add up to 146.84. But rounding the displayed numbers to one digit, these would be displayed as 84.1 plus 62.8 adding up to 146.8. This is the correct output to produce even though it doesn't seem to add up properly.

You should use static methods to eliminate redundant code and to break the problem up into logical subtasks. Your main method should be short so that a person can easily see the overall structure of the program. You should avoid "chaining" long sequences of method calls together without returning to main. You are to introduce at least five static methods other than main and round1 to break this problem up into smaller subtasks and you should make sure that no single method is doing too much work. In this program, none of your methods should have more than 15 lines of code in the body of the method (not counting blank lines or lines with just curly braces on them). The 15-line limitation is a special requirement for this assignment because we want to force you to practice breaking up a program into methods. Be sure to once again include a short comment at the beginning of your program as well as a short comment for each method describing what it does. Look at the program BMI2.java discussed in lecture for a good example of eliminating redundant code and breaking a problem up into logical subtasks (see also the discussion of this program in section 4.6 of the textbook). Also remember that because this program involves both integer data and real data, you need to use appropriate type declarations (type int and calls on nextInt for integer data, type double and calls on nextDouble for real-valued data). Finally, you should construct only one Scanner object for console input.
Name your program Admit.java and to access Scanner include the following at the beginning of your program:
import java.util.*;

This handout has a sample execution and the output comparison tool on the class web page has other samples. You are required to exactly reproduce the format of these sample executions. Limit yourself to constructs from chapters 1 through 4 of the textbook. You should not be using for loops as a way to solve this problem.

Reference no: EM13781401

Questions Cloud

Development and characteristics of abstract expressionism : Discuss the development and characteristics of Abstract Expressionism; be sure to include Gorky, Pollock, and de Kooning in your discussion, using examples of their work as discussed in the text.
Complaints of subordinates regarding delegation : Discuss why one of the major complaints of subordinates regarding delegation is the issue of dumping. Offer an example of a personal experience or observation of dumping taking place.
Create a form to register a user to an online store : Create a form to register a user to an online store. User must create a username and password. These are required and the password must not be shown in clear text. Password should include a way to confirm password.
Write a program that reads an infix or postfix expression : Write a program that reads an infix or postfix expression from an input file, evaluates the expression and outputs the result.
Java program that prompts for the gpa : This assignment will give you practice with interactive programs, if/else statements and methods that return values. Your program will prompt the user for information about two applicants and compute an overall score for each applicant. This is ..
Write a query to display the starting salary : Write a query to display the starting salary for each employee. The starting salary would be the entry in the salary history with the oldest salary start date for each employee. Sort the output by employee number.
Draw the data flow diagrams level 0 : draw the Data Flow Diagrams Level 0 and Level 1 using Microsoft Visio. A visitor may get Registration after filling "Sign Up" form.
Write an application that uses a one dimensional array : Write an application that uses a one dimensional array: the user enters 5 numbers, each of which is between 10 and 100. As each number in input, display it only if it is not a duplicate of previous numbers entered.
Write a function that accepts an integer parameter : Write a function that accepts an integer parameter and returns its integer square root. The function should throw an exception if it is passed an integer that is not a perfect square. Demonstrate the function with a suitable driver program

Reviews

Write a Review

JAVA Programming Questions & Answers

  Shows the users name and program name

Java program, the program has a page that shows the users name and program name. a second jpanel that shows 4 buttons (circle square rectangle and oval) the problem i am having is that my program is not dropping where i click and the shapes are not s..

  Write a program arrayprocessing.java

Write a program ArrayProcessing.java that reads a file name from the keyboard. The file contains integers, each on a separate line. You then create a corresponding array with integers from the lines.

  Album name instance variable

Design a CD class where a CD object represents a single music CD. What kinds of information (artist, genre, total playing time, etc.) do you want to know about a CD?StateAlbum Name instance variable

  Java application to carry out additions and subtractions

Design a Java application to carry out additions and subtractions for numbers of any length. A number is represented as an object which includes a sign and two strings for the whole and decimal parts of the number.

  The 7th test of credits

The 7th test of credits? this is the 7th test of credits? this is the 7th test of credits? this is the 7th test of credits?this is the 7th test of credits?this is the 7th test of credits?this is the 7th test of credits?this is the 7th test of credits..

  Ask the user how many times you want to run

c the algorithm. 2. Then choose a word at random from the array of Strings as the target (Use the integer random number generator)

  Create at least two vectors and demonstrate the use of each

Create a separate class, VectorTest, that will demonstrate the use of your Vector class. You must create at least two vectors, and demonstrate the use of each method. When you demonstrate the use of each method, print the results to the console ..

  Write a program to compute the cumulative gpa

This program will compute the cumulative GPA based on user input.  This program will use dialog boxes with the JOptionPane class as well as the console to send/receive information to/from the user.

  Prepare an app that calculates the product of a series

Prepare an app that calculates the product of a series of integers that are passed to method   product using a variable-length argument list.

  Determine the visual resolution of resulting image

Drawing in 8.5 by 11 inch sheet is digitized by means of 300 dpi (dots per inch) scanner. Determine the visual resolution of resulting image (number of dots in each dimension)?

  Take a position on whether or not an object-oriented

take a position on whether or not an object-oriented approach can be used to develop any type of system. provide two

  Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd