1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zavuch27 [327]
4 years ago
15

Write a program that converts an input grade from 60 to 100 and outputs a converted grade from 0.0 to 4.0. a. Minimum input valu

e is 60, maximum is 100. b. All whole numbers must display as decimals. (0 displays as 0.0 and 3 as 3.0) The solution requires that you create a simple mathematical expression that converts the input value into the output value
Computers and Technology
1 answer:
devlian [24]4 years ago
6 0

Answer:

import java.util.Scanner;

public class num7 {

   public static void main(String[] args) {

      Scanner in = new Scanner(System.in);

       System.out.println("Enter the grade 60-100");

       double grade = in.nextDouble();

       while(grade<60 ||grade>100){

           System.out.println("Enter a valid grade 60-100");

           grade= in.nextDouble();

       }

       double outVal;

       if(grade>=60 && grade<70){

            outVal = 0.0;

       }

       else  if(grade>=70 && grade<80){

           outVal = 1.0;

       }

       else  if(grade>=80 && grade<90){

           outVal = 2.0;

       }

       else if(grade>=90 && grade<100){

           outVal = 3.0;

       }

       else{

           outVal = 4.0;

       }

       System.out.println("The converted grade is: "+outVal);

   }

}

Explanation:

  1. The program is written in Java
  2. User is prompted to enter a grade between 60-100
  3. A while loop is used to validate user input
  4. If/else if/else statements are used to convert the values as required
  5. the output value is stored as a double

You might be interested in
You are driving in the right lane of a municipal road the road has three lanes in your direction ahead of you in the lane to you
Mrrafil [7]
Pull Over. Do NOT Try to push the brake or try swerving with the steering wheel. Slowly pull to the side
7 0
3 years ago
Read 2 more answers
This describes what is charted. It can be placed above or below the chart.
Tems11 [23]

Answer:

a . chart area

This describes what is charted. It can be placed above or below the chart.

Explanation:

3 0
3 years ago
Create a Racket procedure compute_pos that reads numbers from the keyboard until 0 is read, count how many positive numbers are
Artyom0805 [142]

Answer:

import java.util.Scanner;

public class Solution {

   public static void main(String args[]) {

       compute_pos();

     }

     

     public static void compute_pos(){

     Scanner scan = new Scanner(System.in);

     int sum = 0;

     int counter = 0;

     // Prompt the user to enter an input

     System.out.println("Enter your value");

     // user input is assign to the variable value

     int value = scan.nextInt();

     

     while(value != 0){

         if (value > 0){

             sum += value;

             counter++;

         }

         System.out.println("Enter your value");

         value = scan.nextInt();

     }

     // Display the value of sum to the user

     System.out.println("The sum of the positive number is: " + sum);

     // Display the value of counter to the user

     System.out.println("The number of positive number is: " + counter);

   }

}

Explanation:

The first line import the Scanner class which allow the program to read input from the user. The class Solution is then defined. Then the main method which signify the beginning of execution in the program is defined. A method is called inside the main method.

The method compute_pos is defined. Inside the compute_pos method, a scanner object scan is declared to accept input from the user via the keyboard.

The variable sum and counter is declared and assigned to 0.

A prompt is displayed to the user to input a value. The user input is accepted and stored in the variable value.

Then a while loop is use to check the user input if it is not equal to zero. If it is equal to zero, the loop will end. Inside the loop, we first check to see if the user input is greater than 0, if it is, we add it to the variable sum and increase our counter by 1. At the end of the loop, a prompt is again display to accept input from the user.

Outside the loop, we display the sum and counter to the user.

8 0
4 years ago
Most information security incidents will occur because of _________. Select one: a. Users who do not follow secure computing pra
nika2105 [10]

Answer:

Users who do not follow secure computing practices and procedures

Explanation:

Most data breaches that occur as a result of hacking and cyber-attacks get all the attention. However, the kind of mistakes that employees make in corporate situations can sometimes be very costly. Whether accidental or not, human error is the leading cause of most information security breaches. When you have proper policies, people working in big organizations, for instance, will know how they are to do with them. Organizations should put more effort on its employees. By ensuring that secure computing practices and procedures are followed, it will help guide the workforce more effectively.

4 0
4 years ago
Which of the following is a variable expense for many adults?
IRINA_888 [86]
<span>C. Their monthly rent payment.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • How can users create a shortcut to favorite websites and store them in their browser?
    8·2 answers
  • Schools are businesses that need to install software on a large number of computers can usually obtain a ______
    13·1 answer
  • How has science fiction influenced technology
    7·2 answers
  • Which of the following is a preferable method to secure wireless access in a SOHO?
    12·1 answer
  • Given a collection of n nuts and a collection of n bolts, arranged in an increasing order of size, give an O(n) time algorithm t
    5·1 answer
  • What is the difference between skew and rotate in the MS Paint application?
    14·2 answers
  • Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a
    10·1 answer
  • How to send an email to multiple recipients individually.
    9·1 answer
  • When a support agent does not know the answer to a question, a good incident management strategy is to tell the user ____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!