The following
If month is 1,2, or 3, season = “Winter”
Else if month is 4, 5, or 6, season = “Spring”
Else if month is 7, 8, or 9, season = “Summer”
Else if month is 10, It, or 12, season = “Fall”
If month is divisible by 3 and day >= 21
If season is “Winter”, season = “Spring”
Else if season is “Spring”, season = “Summer”
Else if season is “Summer”, season = “Fall”
Else season = “Winter”
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
BIG JAVA: LATE OBJECTS
Additional Engineering Textbook Solutions
Introduction to Programming Using Visual Basic (10th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Java How To Program (Early Objects)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Management Information Systems: Managing The Digital Firm (16th Edition)
Absolute Java (6th Edition)
- visual basic problemarrow_forwardCelebrity problem A celebrity among a group of n people is a person who knows nobody but is known by everybody else. The task is to identify a celebrity by only asking questions to people of the form: ”Do you know him/her?” Solution Select two people from the group given, say, A and B, and ask A whether A knows B. If A knows B, remove A from the remaining people who can be a celebrity; if A doesn’t know B, remove B from this group. Solve the problem recursively for the remaining group of people who can be a celebrity Which design strategy does the following solution use? A-)Decrease-by-a-constant factor algorithm B-)Variable-size-decrease algorithm C-)Decrease-by-a-constant algorithm D-)Divide-and-Conquerarrow_forwardsolve it as algorithmarrow_forward
- Question 3: Write an algorithm that computes the Body Mass Index (BMI) given the heights and weights of students. The algorithm should first read the total number of students and then read the height and weight of each student to calculate and print the BMI category. A student is considered Underweight if the BMI is less than or equal to 18.5; Normal Weight if between 18.5 and 24.9; Overweight if between 25 and 29.9; and Obese if greater than or equal to 30.arrow_forwardsolve it pleasearrow_forwardThe bottom-up make change algorithm has been run using A = 13, C = { 2, 3, 4, 5}. However, the results table is incomplete. Select the correct options for E,F,G,H shown in the green squares beloW YOU MAY ASSUME ALL THE OTHER NUMBERS ARE CORRECT Results Table 1 10 11 12 13 0. Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf 1 Inf Inf Inf Inf Inf 6. Inf Inf 1 3 4 4 Inf 1 1 1 3 4 Inf 1 | F 1 3 a. E=1, F=,1 G=2, H=1 b. E=2, F=2, G=3, H=1 C. E=1, F=1, G=2, H=3 d. E=2, F=2, G=1, H=3 e. E=1, F=1, G=1, H=2 3. 4, 3. 4, 3. 2. 3. 3. 2. 8. 4) 3. 2. 7. 2. 2. 3. 2. 2. 5 2. 2. 4, 2. 2. 2. 2. 3. 5arrow_forward
- For this homework assignment, you are asked to design an algorithm to compute the employee's bonus using the rules shown below: Bonus Schedule Overtime - (2/3) * Absent Bonus Paid greater than 40 hours = $50 ,greater than 30 but less than 40 hours =$40 ,greater than 20 but less than 30 hours =$30, greater than 10 but less than 20 hours= $20 ,less than 10 hours =$10arrow_forwardwrite this in pseudocode #4 – In pseudocode, write a for-loop that decreases from 100 to 2 by 2s. Inside the loop, print the value of the loop variable unless the value is from 60 to 80 (inclusive). Use only 1 if-statement. Do NOT write Python code! Write your answer below: #5 – Review the decision structure given below. If myAnswer > 20 Then myAnswer = myAnswer - 25Else If myAnswer <= 5 Then If myAnswer < 0 Then myAnswer = 10 If myAnswer < 3 Then myAnswer += 10 Else myAnswer += 1Else myAnswer = 9 If myAnswer < 10 ThenmyAnswer += 1 Display myAnswer What are the results displayed when the decision structure above executes for each given value below:If myAnswer = 6 then myAnswer = myAnswer = 15 then myAnswer = myAnswer = 30 then myAnswer = myAnswer = 2 then myAnswer = myAnswer = -1 then myAnswer = #6 – 2-dimensional arrays can be thought of as containing rows…arrow_forwardIn C# thanks!arrow_forward
- Problem definition: We want to write a Python program for n players, which are playing a toumament. In this competition players solve 5 simple arithmetic problems. The arithmetic problems consist of simple addition operations of the form: numberl + number2 =_ where the operands numberl and number2 are randomly generated. Initially your program displays a menu to enter the number of players and the difficulty level as shown in figure 1: Tournanent_ quiz Enter number of players : 3 Player 1 Level: E or e for Easy - A or a for Advanced level level Enter your choice : x Incorrect input try again Level: - E or e for Easy - A or a for Advanced level level Enter your choice : E Figure 1 Program initial menu The difficulty level determines the number of digits in the operands numberl and number2: • Easy level means the operands consists of a unique digit (0, 1, 2,, 9). • Advanced level means the operands consists of two digits (10, 11,., 99). Use the random number generator to determine…arrow_forwardProblem definition: We want to write a Python program for n players, which are playing a tournament. In this competition players solve 5 simple arithmetic problems. The arithmetic problems consist of simple addition operations of the form: питberl + пumber2 3D where the operands number1 and number2 are randomly generated. Initially your program displays a menu to enter the number of players and the difficulty level as shown in figure 1: Tournament_ quiz Enter number of players : Player 1 Level: - E or e for Easy - A or a for Advanced level level Enter your choice : x Incorrect input try again Level: level - A or a for Advanced level Enter your choice : E Figure 1 Program initial ment The difficulty level determines the number of digits in the operands number1 and number2: • Easy level means the operands consists of a unique digit (0, 1, 2,.., 9). Advanced level means the operands consists of two digits (10, 11,.., 99). Use the random number generator to determine numberl and number2.…arrow_forwardWrite an algorithm that reads from the user several lines of input. Each line includes a student's name and his/her GPA (as a real number). The algorithm should calculate and print the highest GPA and name of the student who has achieved it. Hints: · You could assume that the user will insert valid data and at least one student. · You could assume that all students have distinct GPAS. · User could stop the program via entering the word "stop" as a student's name. · The input and output of your program should be exactly as in the sample below. Sample Input and Output: In each line, insert a student's name and his/her GPA To halt the algorithm, insert "stop" as a student's name Output from the program Areej 3.11 Soha 2.50 Maher 3.68 Input from the user Taher 2.93 stop Maher has the highest GPA, which is 3.68 Output from the programarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr