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
marishachu [46]
3 years ago
9

Write a program named TypingGrades that allows a user to enter a student’s number of words typed. The output is the letter grade

. For example, if 8 words typed is input, the output should be Typing 8 words per minute: Grade F.
Computers and Technology
1 answer:
Vadim26 [7]3 years ago
6 0

complete question:

Write a program named TypingGrades that allows a user to enter a student’s number of words typed. The output is the letter grade. For example, if 8 words typed is input, the output should be Typing 8 words per minute: Grade F.

Words typed  Grade

0–15            F

16–30            D

31–50            C

51–75            B

76 and over    A

Answer:

import java.util.Scanner;

public class TypingGrade {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter number of words typed");

       int numWords = in.nextInt();

       if(numWords<=15){

           System.out.println("Grade F");

       }

       else if(numWords>=16 && numWords<=30){

           System.out.println("Grade D");

       }

       else if(numWords>=31&&numWords<=50){

           System.out.println("Grade C");

       }

       else if(numWords>=51 && numWords<=75){

           System.out.println("Grade B");

       }

       else{

           System.out.println("Grade A");

       }

   }

}

Explanation:

  • Using Java programming Language
  • Import Scanner Class to prompt and receive user input of number of words typed
  • Use if..elseif...else statements to test each condition (the range of words) given in the question to print the expected output.

You might be interested in
Importance of computer education​
Stells [14]

Answer:

hope this helped

Explanation:

Computer technology has helped the world to grow and evolve quickly. By performing tasks quickly, computers make daily activities more convenient. They give people access to a wide array of information and can reach even the most remote locations on the planet.

6 0
3 years ago
Description:
Nastasia [14]

Answer:

The programming language is not stated (I'll answer using C++)

#include <iostream>

using namespace std;

int convert(float miles)

{

   return miles * 5280;

}

int main() {

   cout<<"Console:"<<endl;

   cout<<"Hike Calculator"<<endl;

   float miles;

   char response;

   cout<<"How many miles did you walk?. ";

   cin>>miles;

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

   cout<<"Continue? (y/n): ";

   cin>>response;

   while(response == 'y')

   {

   cout<<"How many miles did you walk?. ";

   cin>>miles;

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

   cout<<"Continue? (y/n): ";

   cin>>response;

   }

   cout<<"Bye!";

   return 0;

}

Explanation:

Here, I'll explain some difficult lines (one after the other)

The italicized represents the function that returns the number of feet

<em>int convert(float miles) </em>

<em>{ </em>

<em>    return miles * 5280; </em>

<em>} </em>

The main method starts here

int main() {

The next two lines gives an info about the program

   cout<<"Console:"<<endl;

   cout<<"Hike Calculator"<<endl;

   float miles;

   char response;

This line prompts user for number of miles

   cout<<"How many miles did you walk?. ";

   cin>>miles;

This line calls the function that converts miles to feet and prints the feet equivalent of miles

   cout<<"You walked "<<convert(miles)<<" feet"<<endl;

This line prompts user for another conversion

   cout<<"Continue? (y/n): ";

   cin>>response;

This is an iteration that repeats its execution as long as user continue input y as response

<em>    while(response == 'y') </em>

<em>    { </em>

<em>    cout<<"How many miles did you walk?. "; </em>

<em>    cin>>miles; </em>

<em>    cout<<"You walked "<<convert(miles)<<" feet"<<endl; </em>

<em>    cout<<"Continue? (y/n): "; </em>

<em>    cin>>response; </em>

<em>    } </em>

   cout<<"Bye!";

8 0
4 years ago
Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn c
barxatty [35]

Answer:

#include <string>

#include <iostream>

using namespace std;

int main() {

string userInput;

getline(cin, userInput);

// Here, an integer variable is declared to find that the user entered string consist of word darn or not

int isPresent = userInput.find("darn");

if (isPresent > 0){

cout << "Censored" << endl;

// Solution starts here

else

{

cout << userInput << endl;

}

// End of solution

return 0;

}

// End of Program

The proposed solution added an else statement to the code

This will enable the program to print the userInput if userInput doesn't contain the word darn

6 0
3 years ago
Plz plz plz plz plz plz plz plz plz plz plz pl plz plz plz plz plz plz plz plz plz plz plz plz olz plz plz
zvonat [6]

REM PROGRAM TO DISPLAY AVERAGE OF TWO NUMBERS

CLS

INPUT “ENTER FIRST NUMBER”; A

INPUT “ENTER SECOND NUMBER”; B

INPUT “ENTER THIRD NUMBER”; C

AV = (A + B + C) / 3

PRINT “AVERAGE OF THREE NUMBERS”; AV

END

hope this helpz

6 0
3 years ago
Search the link <br><br> gKuJXd3zYDc<br><br> Subscribe I have a vid premiering soon
lawyer [7]
I will hope this helps :p
5 0
3 years ago
Other questions:
  • Which access object(s may be used when creating a lookup field to select valu?
    8·1 answer
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • Help! live preview in brackets is not working
    8·1 answer
  • Using PowerPoint or Impressed guarantees that your presentation will do which of the following?
    6·1 answer
  • If a client is found _________ the NAP will attempt to make it _______. Group of answer choices A. non-compliant, compliant B. s
    13·2 answers
  • What can a scientist do if he repeats and experiment and gets diffrent results?
    5·1 answer
  • Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In the JUNGLE world there are 4 p
    7·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • The students of a college have to create their assignment reports using a word processing program. Some of the questions in thei
    9·1 answer
  • Question #5
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!