Explore BrainMass

Java Help 3

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

A local middle school hired you to write a quiz program that answers questions about Math, Science and the Arts. The program user should be able to select from these topics by entering an option when the program starts. For example, you may use M for Math, S for Science, A for the Arts, and X to exit the program. After the student selects the topic, the program presents a series of questions. The student should answer the question with a one character choice option. The program should provide four options for each question. One option should allow the user to exit from the quiz. Selecting the questions is up to you. If the user responds to a question correctly, the program displays a positive feedback message. If the user responds incorrectly to the question, the program displays the correct answer. The program continues to present questions within the selected topic, for a maximum of five questions, or until the students exits the questions menu. Exiting the questions menu returns the student to the topics menu. At the end of the quiz, the program displays the total number of correct and incorrect answers for each topic. Your code should be well commented.

HINT: This program will require nested loops, the outer loop asking students which category to choose from or selecting to exit the quiz. The inner loop, will cycle through asking the student questions on a particular topic. There are many ways to program these looping structures and terminate the loop when the student enters an "x". A useful feature to terminate a loop early is the break statement.

In addition to the above programming assignment, please also answer the following questions:

Did you use pseudo code to plan your quiz application? If yes, how did it help? If no, what did you use as a plan?

Address the following points about testing your application.

How many test cases did you use to test your application?
Did you perform exhaustive testing on your application? Justify your answer.
How confident are you that your application will not crash if given to a professional test organization to test?
Include your code and the answers to the questions

© BrainMass Inc. brainmass.com October 16, 2018, 4:36 pm ad1c9bdddf

Solution Preview

See attached.

1. You can come up with the test cases yourself. Basically permutate the order of "M" "S" "A" ...

Similar Posting

Java code errors

1. What are the errors in the following codes: What would correct the errors?

A.) if ( age >= 65 ) ;
System.out.println( "Age greater than or equal to 65" );


System.out.println( "Age is less than 65 )";

B.) int x = 1, total;
while ( x <= 10 )

Total += x;


C.) while ( x <= 100 )
total += x;


D.) while ( y > 0 )

System.out.println( y );


2. Drivers are concerned with the mileage their automobiles get. One of my drivers has kept track of several tankfuls of the gas he used and recorded the miles driven and gallons used for each tankful. I need help developing a JAVA application that will input the miles driven and gallons used(both as integers) for each thankful. The program should calculate and display the miles per gallon obtained for each thankful and print the combined miles per gallon obtained for all tankfuls up to this point. All averaging calculations should produce floating-point results. Use class Scanner and sentinel-controlled repetition to obtain the data from the user.

3.) A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus %9 of their gross sales for that week. An example of this would be "a salesperson who sells $5000 worth of merchandise in a week receives $200 plus %9 of $5000 or a total of $650. I have been supplied with a list of the items sold by each salesperson. The value of these items are listed below:

Item Value
1 239.99
2 129.75
3 99.95
4 350.89

I need help developing a Java application that inputs one salesperson's items sold for last week and calculates and displays that salesperson's earnings. There is no limit to the number of items that can be sold by a salesperson.

View Full Posting Details