Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

jHi I've been kind of stumped on this homework assignment. I'm currently on B and cant figure out how to use continue; in my program.

image text in transcribedimage text in transcribedjHi I've been kind of stumped on this homework assignment. I'm currently on B and cant figure out how to use "continue;" in my program.

This is what I have so far:

import java.util.Scanner;

public class pass5A {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("What class are you rating?:");

String classRate = scan.nextLine();

System.out.println("How many plus signs does ICS111 get?:");

int plusSign = scan.nextInt();

System.out.print("ICS111:");

{

if (plusSign >= 6)

System.out.println("Sorry, but you can only give a rating of 0-5");

int i = 0;

{

if ((i = 5))

while (i

if (plusSign >= 6) {

continue;

}

System.out.print("+");

i++;

}

}

}

}

}

A. Write a program that reinterprets a course rating as follows: Computer prints and waits for input: What class are you rating? How many plus signs does ICS-111 get? Example user input: ICS-111 Computer prints: ICS-111: + + + + + Your program should print as many plus signs as the user inputs. For example: If the input is 0, the program prints no plus signs If the input is 1, the program prints + If the input is 2, the program prints + + If the input is 3, the program prints + + + ...and so on. Use a loop to generate the plus signs so that your program should work with any positive number. What happens if a user puts in a negative number (try it)? B. Modify the program you wrote in part A so that accepts only 0-5. If a user puts in a number out of range, your program should say Sorry, but you can only give a rating of 0-5 and then loop back to ask again. C. Modify the program you wrote in part B so that it asks about 3 courses. For example: ICS-111 What class are you rating? How many plus signs does ICS-111 get? ICS-211 What class are you rating? How many plus signs does ICS-111 get? ICS-311 What class are you rating? How many plus signs does ICS-111 get? ICS-111: + + ICS-211: + + + + ICS-311: + + + + + D. (Extra credit, 10 points). Modify your program from part C so that it will keep asking about courses until the user inputs Done for the name of the course. The output of the program should then be as many courses as the user has rated

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

Students also viewed these Databases questions

Question

Why is job analysis considered to be a basic HR tool?

Answered: 1 week ago

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago

Question

Discuss about training and development in India?

Answered: 1 week ago

Question

Explain the various techniques of training and development.

Answered: 1 week ago

Question

5. Prepare for the role of interviewee

Answered: 1 week ago

Question

6. Secure job interviews and manage them with confidence

Answered: 1 week ago