need help coding
$10-30 USD
Betalt ved levering
i want to write a java code Write a program that does the following
Display the following menu
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
Only valid selection is 1 or 2, anything else you keep looping and displaying the menu.
If 1 selected, then have the program call method sumANDaverageandCount todo the following:
a) Ask user to enter numbers (positive or negative) and stop on X
b) Read numbers and calculate sum & average
c) print the sum and average
If 2 selected, then have the program call method minANDmax to do the following:
a) Ask user to enter numbers (positive or negative) and stop on X
b) Read numbers and calculate max & min
c) print the max and min
Anything else selected that is not 1 or 2 then the program loops and display the choices 1 & 2 and waits to read the user input.
After finishing the task of part 1 or part2 the program prints Goodbye and program ends.
You must use the following template for your program.
public class Loops
{
public static void minANDmax() {
/*
*your code goes to here to read a set of integeres from the keyboard
* and x to stop reading. The method then determines the minimum number
* read and the maximum number read then print to the screen both the
* max & min
*
*/
}
public static void sumANDaverageandCount() {
/*
*your code goes to here to read a set of integers from the keyboard
* and x to stop reading. The method then calculates the sum, the count,
* and the average and prints both numbers to the scree
*
*/
}
public static void main(String[] args) {
/**
* your code goes her to display the menue for choice 1 or 2 then read the
* data. Stay in loop if number entered is not 1 nor 2. If it
* is either 1 or 2, then exit loop and check if 2 is entered then call
* method minANDmax else if 1 is entered then call method
* sumANDaverageandCount. Finally print goodbye to screen.
*/
}
}
Here is a sample run with selection 1
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
1
Enter + or - numbers and x to stop
1 2 3 4 5 6 x
Sum= 21
Count= 6
Average= 3
Goodbye
Here is a sample run with selection 2
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
2
Enter + or - numbers and x to stop
1 2 5 3 7 0 4 x
Max = 7
Min = 0
Goodbye
Here is a sample run with wrong menu choice 0 and 9 and finally correct menu choice 2
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
0
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
9
1. Calculate sum & average of a set of numbers
2. Find the max and min of a set of numbers
Make a selection [enter 1 or 2]:
2
Enter + or - numbers and x to stop
1 2 5 3 7 0 4 x
Max = 7
Min = 0
Goodbye
-
Projekt ID: #27307931
Om projektet
Tildelt til:
I am a C/C++, Python, Java expert with 2 years of competitive programming experience with knowledge of Data structures and algorithms and I can do your work as soon as possible. Can we discuss more on this project on c Flere
6 freelancere byder i gennemsnit $23 timen for dette job
Hello, My name is Nazeer and I'm a full-time freelancer from Pakistan. I read your job offer regarding the java task and I'm ready to start right away. I am also flexible with whatever budget you have. Accuracy and cl Flere
Hello, Sure I'll provide programming code on java according your guidelines. If you gave us your project you will get better service from us. Thanks & Regards Hamza
I am currently pursuing Computer Engineering. I've worked with various programming languages(Python, Core Java, C++, C) and can complete this within a day.
Greetings ! Just saw your project post about Java programming. I am Bilal, being a Computer engineer, I believe myself to be capable of doing wonders in MANY fields. I have read the complete job description and I can Flere