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

Instructions for writing a java program that prompts the user for two floating point values, computes their average, and generates a message based on the computed average. The message 'satisfactory' is output if the average is greater than or equal to 70.0, and 'unsatisfactory' otherwise. The program must be written using the joptionpane for input and output operations, and must include the class definition and necessary import statements.

Typology: Quizzes

Pre 2010

Uploaded on 07/30/2009

koofers-user-7xg
koofers-user-7xg 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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.