a.
Explanation of Solution
Program:
File name: “CountByFives.java”
//Define a class named CountByFives
public class CountByFives
{
//Define main method
public static void main(String[] args)
{
//For loop that counts by five from 5 through 500
for(int i = 5 ; i <= 500 ; i+=5)
{
//Print the result
System...
b.
Explanation of Solution
Program:
File name: “CountByAnything.java”
//Import necessary header files
import java.util.Scanner ;
//Define a class CountByAnything
public class CountByAnything
{
//Define main method
public static void main(String[] args)
{
//Create scanner class
Scanner sc = new Scanner(System.in);
//Prompt the user to enter an integer
System.out.print("Enter an integer:");
//Get the integer from the user
int n = sc.nextInt();
//Declare a variable and initialize the value
int count = 0 ;
/*For loop that counts by the entered number from 5 through 500*/
>&#...
Trending nowThis is a popular solution!
- Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name. import java.util.*; public class BirthdayReminder { public static void main(String[] args) { // Write your code here } }arrow_forwardWrite an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name.arrow_forwardFaster please!arrow_forward
- What is the output of the following code segment?inte=5,f=10;if(eff0) Write(Red); else Write(Orange);Â a. Red b. Orange c. RedOrange d. nothingarrow_forwardWhat is the output of the following code segment?intc=6,6=12;if(cd);Write(Green);WriteLine(Yellow); Green Yellow GreenYellow nothingarrow_forwardTask 5: ScanningMoney.java Write a program that reads User Input using the Scanner class. Your program should ask the user how many quarters, nickels, dimes, and pennies they have, then display the total amount in dollars. This can be done in main method. Expected Output The highlighted text denotes text that you type into the console yourself. It is not printed by the program. Due to floating point values being used your answer may have the trailing 1 or not. ----JGRASP exec: java ScanningMoney Quarters: 4 Dimes: 3 Nickels: 2 Pennies: 1 You have $1.4100000000000001 ----JGRASP: operation complete.arrow_forward
- Write an application that allows a user to enter any number of student test scores until the user enters 999. If the score entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered, the highest score, the lowest score, and the arithmetic average. Save the file as TestScoreStatistics.cpp.arrow_forwardJava:arrow_forwardCreate a modularized Rock, Paper, and Scissors game that lets user play 7 Rock, Paper, and Scissors game against computer. The program should display each game's result and the final result for the 7 games. The program should contain the following procedures: getComputerChoice receives nothing but returns a word randomly picked from Rock, Paper, and Scissors. getUserChoice receives nothing but returns a word user picked from Rock, Paper, and Scissors. play receives computerPicked and userPicked and returns winner's name, computer or user. main: call the above procedures 7 times, display each game's result, and final result summary any way i can get help creating this in raptor flowchart?arrow_forward
- In Java Create a class WhileEvent3, write code that asks the user to enter a positive or negative number or 'x' 'X' to quit the program. When out of the loop the sum of all numbers entered is printed. READ THE USER'S input as String an not as integer.arrow_forwardCreate a program that reads integers from the user until the enter key is pressed. Onceall of the integers have been read your program should display all of the negativenumbers, followed by all of the zeros, followed by all of the positive numbers. Withineach group the numbers should be displayed in the same order that they were enteredby the user. For example, if the user enters the values 3, -4, 1, 0, -1, 0, and -2 thenyour program should output the values -4, -1, -2, 0, 0, 3, and 1. Your programshould display each value on its own line.arrow_forwardJava Programmingarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,