- Details
- Parent Category: Programming Assignments' Solutions
We Helped With This JAVA Programming Assignment: Have A Similar One?
Short Assignment Requirements
Assignment Description
CST8110 – Assignment 1
Due date: Feb 17, 2019
What to submit: FiveNumbers.java and HelpMe.java
First Challenge [2 points] – FiveNumbers.java
Write a program that accepts from the user five numbers between 0 – 250. No duplicates and in any order (no need to check for duplicates).
Your program should display the following:
- Sum of all numbers entered
- Average of all numbers entered. The average needs to be a decimal number - Product of all numbers entered
Using only what was covered in chapters 2 and 3, your programs needs to display the following as well:
- If any of the numbers entered can be represented as a letter [a-z or A-Z] using the ASCII table, your program needs to display all these letters, one after the other, with one space in between. Special characters (à, è, é …) are not part of this section
- If any of the numbers entered cannot be represented as a regular letter using the ASCII table, your program needs to display all these numbers, one after the other, with one tab in between
Your class needs to be called FiveNumbers.java
Please make sure that your class name is, case sensitive, exactly what is required. Anything different will cause a deduction in marks.
BONUS: If you are able to output the list of letters and the list of number in an ascending order, you will get a bonus point. So, the below output with the bonus part would be:
Letters: c k n
Numbers: 10 20
Sample Output
Please enter first number: 20
Please enter second number: 75
Please enter third number: 10
Please enter fourth number: 110
Please enter fifth number: 99
Sum: 314
Average: 62.8
Product: 163350000
Letters: c n k
Numbers: 20 10
Second Challenge [2 points] – HelpMe.java
Your job here is to direct a sick user whether they need to stay home, go visit a walk-in clinic, go to ER (Emergency Room) or call 911 for an ambulance.
We will assume that the user is not feeling well and that they are running your program for guidance.
You will need to ask the user for their symptoms by offering them to pick from a list of five: nausea, dizziness, fever, headache and vomit. Based on their answers, you need to determine which of these five symptoms they are experiencing. They can be experiencing none and up to all of them.
You will prompt the user to enter their body temperature in Celsius (C ) or Fahrenheit (F ), by entering a decimal number with a capital F or capital C at the end of it.
If temperature is above 38 (C ) but below 39 (C ) inclusive, and experiencing three or more of the symptoms
- Your program should recommend that they go visit a walk-in clinic
- Your program should display their temperature in Celsius and Fahrenheit
If temperature is above 39 (C ) but below 40 (C ) inclusive, and experiencing four or more of the symptoms
- Your program should recommend that they go to ER
- Your program should display their temperature in Celsius and Fahrenheit
If temperature is above 40 (C ) and experiencing all the symptoms
- Your program should recommend that they call for an ambulance immediately by dialing 911
- Your program should display their temperature in Celsius and Fahrenheit
If they do not meet any of the conditions listed above
- Your program should recommend that they need to rest, take Advil or Tylenol, drink lots of Gatorade and stay home
- Your program should display their temperature in Celsius and Fahrenheit
Sample Output:
<Optional: some one-line intro about your program>
<I will leave you to determine how to ask the user to indicate which symptoms they are experiencing>
Please enter your body temperature in Celsius or Fahrenheit by appending a C or an F to the temperature value: 37.5C
<Your program should display the recommendation as stated above>