Write a complete Java program, including comments in both the main program and in each method, which will do the following: 0. The main program will start by calling a method named introduction() which will print out a description of what the program will do at the top of the first output page. This first method is called just once. This method will not be sent any parameters, and it will not return a value. It will print several lines of output explaining what the program does, and it will explain how the program should end (see step 4). 1. The main program will ask the user to type in three integer values, positive, negative, or zero (see step 4). The main program will print the three numbers right after they are read in. 2. The main program will call a method named findsum(), sending it the three integer values. The method will determine the sum of the larger 2 of the three values, sending the answer back to the main program. The main program will print the value returned. For example, if you send 4 6 2 to the method, the method will return 10, (4+6) and the main program will print that 10 is the sum. 3. The main program will call a method named printmyname(), sending it one parameter -- the sum of the integer values calculated in step 2. The method will print your name that many times, and the method will not return a value. (Be careful - see below.) For example, if the parameter to the method is 2, then the method should print your name 2 times. If the parameter is 4, the method should print your name 4 times. However, if the parameter sent in is less than or equal to 0, or if the parameter sent in is greater than 10, the method will say it is not possible to print the name. |For example, if the parameter is -2, the method will say in this case it is not possible to print the name. If the parameter is 12, the method will say it is not possible to print the name. 4. The main program will call a method named howmanyeven, sending it all three integers. The method will determine how many (0,1,2,0r 3) of the values are even and return that value to the main program. (Hint: Even means divisible by 2 with no remainder, and there is an operator that will tell you the remainder.) The main program will print an appropriate message: There is/are_ even number(s). 5. Then the main program will skip a few lines and go back to step 1 (not step 0). At step 1, if the user types in a special combination, the program will go to step 5. You must determine what this combination is, and you must explain it-in a prompt or in a comment, and in the introduction at the beginning--to the person using the program. 6. At the end, print how many sets of three data values were entered and processed. Make sure that this value is at least 8.
Write a complete Java program, including comments in both the main program and in each method, which will do the following: 0. The main program will start by calling a method named introduction() which will print out a description of what the program will do at the top of the first output page. This first method is called just once. This method will not be sent any parameters, and it will not return a value. It will print several lines of output explaining what the program does, and it will explain how the program should end (see step 4). 1. The main program will ask the user to type in three integer values, positive, negative, or zero (see step 4). The main program will print the three numbers right after they are read in. 2. The main program will call a method named findsum(), sending it the three integer values. The method will determine the sum of the larger 2 of the three values, sending the answer back to the main program. The main program will print the value returned. For example, if you send 4 6 2 to the method, the method will return 10, (4+6) and the main program will print that 10 is the sum. 3. The main program will call a method named printmyname(), sending it one parameter -- the sum of the integer values calculated in step 2. The method will print your name that many times, and the method will not return a value. (Be careful - see below.) For example, if the parameter to the method is 2, then the method should print your name 2 times. If the parameter is 4, the method should print your name 4 times. However, if the parameter sent in is less than or equal to 0, or if the parameter sent in is greater than 10, the method will say it is not possible to print the name. |For example, if the parameter is -2, the method will say in this case it is not possible to print the name. If the parameter is 12, the method will say it is not possible to print the name. 4. The main program will call a method named howmanyeven, sending it all three integers. The method will determine how many (0,1,2,0r 3) of the values are even and return that value to the main program. (Hint: Even means divisible by 2 with no remainder, and there is an operator that will tell you the remainder.) The main program will print an appropriate message: There is/are_ even number(s). 5. Then the main program will skip a few lines and go back to step 1 (not step 0). At step 1, if the user types in a special combination, the program will go to step 5. You must determine what this combination is, and you must explain it-in a prompt or in a comment, and in the introduction at the beginning--to the person using the program. 6. At the end, print how many sets of three data values were entered and processed. Make sure that this value is at least 8.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education