Question
Please help!! I need all three of these to be in java 1.)Input an integer n from the keyboard. Calculate the sum of the first
Please help!! I need all three of these to be in java
1.)Input an integer n from the keyboard. Calculate the sum of the first n integers. So if n=10, the answer should be 55 (because 1+2+3+4+5+6=7+8+9+10=55)
2.) Input an integer from the keyboard. Calculate n! So if n=4, the answer should be 24 (because 1234=24) If n=5, the answer should be 120 (because 1234*5=120)
3.) Ask the user to enter an integer representing a grade between 0 and 100 (-1 to stop) For each grade determine whether it was an A (90 <=grade<=100), B (80<=grade<90), C(70<=grade<80), D(60<=grade<70), F (grade<=60). If it was an A, add one to the count for the number of As. Similarly for B, C, D, F. After the user enters -1 (to quit) output the number of As, number of Bs, number of Cs etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started