Write a program that takes a single number from the user and returns the number
ID: 3782945 • Letter: W
Question
Write a program that takes a single number from the user and returns the number multiplied by the number+7. Example = the number 3 would return 3 times 10 or 30. Example 2 = the number 5 would return 5 times 12 or 60. Remember, you should always output to the user in textual form what is expected for keyboard entry. Make sure you have appropriate comments and output to explain the program's function. After completion and testing, zip the folder and submit via the Assignments link in BlackBoard. You should browse and attach the folder via the browse my computer button and then select the submit button. The final date/time to submit assignments in this folder is Friday, February 10th at midnight.Explanation / Answer
Java code
save it as Solution.java
import java.util.*; //package required for scanner class
public class Solution {
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in); // initialization of scanner
System.out.println("Enter a number");
int n=sc.nextInt(); //take input from user
System.out.println(n*(n+7)); //give output
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.