Hello, In the two pictures I've included, the instructions for the assignment are on the left side of both pictures and

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Hello, In the two pictures I've included, the instructions for the assignment are on the left side of both pictures and

Post by answerhappygod »

Hello, In the two pictures I've included, the instructions forthe assignment are on the left side of both pictures and thealready started program is in the middle section of each picture.Please follow the instructions and get the correct output. Ifyour response is correct, I'll make sure to like your response!
Hello In The Two Pictures I Ve Included The Instructions For The Assignment Are On The Left Side Of Both Pictures And 1
Hello In The Two Pictures I Ve Included The Instructions For The Assignment Are On The Left Side Of Both Pictures And 1 (122.51 KiB) Viewed 46 times
Hello In The Two Pictures I Ve Included The Instructions For The Assignment Are On The Left Side Of Both Pictures And 2
Hello In The Two Pictures I Ve Included The Instructions For The Assignment Are On The Left Side Of Both Pictures And 2 (100.89 KiB) Viewed 46 times
Using a Sentinel Value to Control a while Loop in Java m Using a Sentinel MovieGuide.java Value to Control a while Loop Summary 3 | & In this lab, you write a while loop that uses a sentinel value to control a loop in a Java program that has been provided. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. Each theater patron enters a value from O to 4 indicating the number of stars the patron awards to the Guide's featured movie of the week. The program oxooutor continuouche 1 // MovieGuide.java - This program allows each theater patron to enter a value from 0 to 4 2 // indicating the number of stars that the patron awards to the Guide's featured movie of the 3 // week. The program executes continuously until the theater manager enters a negative number to 4 // quit. At the end of the program, the average star rating for the movie is displayed. 5 6 import java.util.Scanner; 7 8 public class MovieGuide 9 { 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 public static void main(String args[]) { Scanner s = new Scanner(System.in); // Declare and initialize variables. double numStars; // star rating. String numStarsString; double averageStars; double totalStars = 0; int numPatrons = 0; // string version of star rating // average star rating. // total of star ratings. // keep track of number of patrons // This is the work done in the housekeeping() method // Get input. // This is the work done in the detailLoop() method // Convert to double. // Write while loop here // This is the work done in the endOfJob() method
Using a Sentinel Value to Control a while Loop in Java Using a Sentinel Value to Control m = bl & Ⓡ a while Loop Instructions 1. Ensure the file named MovieGuide.java is open. 2. Write the while loop. using a sentinel value to control the loop, and write the statements that make up the body of the loop to calculate the average star rating. 3. Execute the program by clicking Run. 4. Input the following: 0, 3, 4, 4, 1, 1, 2, -1 5. Check that the average output is correct. MovieGuide.java { 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Scanner s = new Scanner(System.in); // Declare and initialize variables. double numStars; // star rating. String numStarsString; double averageStars; double totalStars = 0; int numPatrons = 0; // This is the work done in the housekeeping() method // Get input. // This is the work done in the detailLoop() method // Convert to double. // Write while loop here // string version of star rating // average star rating. // total of star ratings. // keep track of number of patrons // This is the work done in the endOfJob() method // Calculate average star rating System.out.println("Average Star Value: " + averageStars); System.exit(0); } // End of main() method. 36 37 38} // End of MovieGuide class. 39 40 ● X
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply