Docsity

Java Program to Compute Status Based on Average of Two Input Values, Quizzes of Computer Science

Toggle sidebar
bg1
CMSC131 Fall 2004 Quiz #1
Name (Print last name followed by first name):
Student Id:
Section time (10am/11am): TA Names:
Write a Java program that prompts the user for two values, computes the average of the values
and generates a message based on the computed average. The message “Satisfactory” will be
output if the average is greater or equal to 70.0 and “Unsatisfactory” otherwise. The following
restrictions/assumptions apply to this problem:
• The name of the class you will define is ComputeStatus.
• The input values are floating point values. You may use any of the Java floating
point types.
• Input and output operations must be completed using methods associated with
JOptionPane. (You can input the two values using two separate calls to
JOptionPane.)
• You do not need to provide comments; however, you must use meaningful variable
names and good indentation.
• Give a complete program. Include the class definition (not just the main method) and
include any necessary import statements.
• Write the program on the next page.
1
pf3

Partial preview of the text

Download Java Program to Compute Status Based on Average of Two Input Values and more Quizzes Computer Science in PDF only on Docsity!

CMSC131 Fall 2004 Quiz #

Name (Print last name followed by first name): Student Id: Section time (10am/11am): TA Names:

Write a Java program that prompts the user for two values, computes the average of the values and generates a message based on the computed average. The message “Satisfactory” will be output if the average is greater or equal to 70.0 and “Unsatisfactory” otherwise. The following restrictions/assumptions apply to this problem:

  • The name of the class you will define is ComputeStatus.
  • The input values are floating point values. You may use any of the Java floating point types.
  • Input and output operations must be completed using methods associated with JOptionPane. (You can input the two values using two separate calls to JOptionPane.)
  • You do not need to provide comments; however, you must use meaningful variable names and good indentation.
  • Give a complete program. Include the class definition (not just the main method) and include any necessary import statements.
  • Write the program on the next page.