n this lab, you complete a prewritten Java program that computes the largest and smallest of three integer values. Instructions Two variables named largest and smallest are assigned for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate. Your program should prompt the user to enter 3 integers. Write the rest of the program using assignment statements, and if else statements as appropriate. Execute the program by clicking the Run button at the bottom of the screen: Using the input of -50, 53, 78, your output should be: The largest value is 78 The smallest value is -50 Remember: - Program contains the necessary amount of if else statements needed to calculate the output and doesn't contain any hardcoded values. - Program computes the largest and smallest of three integers: Program computes the largest and smallest of the following integers: -50, 78, 53. Program computes the largest and smallest of the following integers: 11, 12, 13. Program computes the largest and smallest of the following integers: -21, -1, -30.
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
In this lab, you complete a prewritten Java program that computes the largest and smallest of three integer values.
Instructions
- Two variables named largest and smallest are assigned for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate.
- Your program should prompt the user to enter 3 integers.
- Write the rest of the program using assignment statements, and if else statements as appropriate.
- Execute the program by clicking the Run button at the bottom of the screen: Using the input of -50, 53, 78, your output should be: The largest value is 78 The smallest value is -50
Remember:
- Program contains the necessary amount of if else statements needed to calculate the output and doesn't contain any hardcoded values.
- Program computes the largest and smallest of three integers: Program computes the largest and smallest of the following integers: -50, 78, 53. Program computes the largest and smallest of the following integers: 11, 12, 13. Program computes the largest and smallest of the following integers: -21, -1, -30.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images