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
aleksandr82 [10.1K]
3 years ago
5

Create a script that asks for the student's percentage point through a prompt box. Using the following scenarios write if else s

tatements that determine the student's letter grade and display the grade in an alert box: Percentage Letter Grade >=90 A Between 80 and 89 B Between 70 and 79 C Between 60 and 69 D Lower than 60 F
Computers and Technology
1 answer:
Valentin [98]3 years ago
5 0

Answer:

<h2>Following are the java script code for the above question. </h2>

Explanation:

Program :

var percentage= prompt("Enter the percentage of the student"); // take the input from the user.

if(percentage>=90)//check condition for greator than 90.

alert("your grade is \"A\"");

else if(percentage>=80) // check condition for 80 and 89.

alert("your grade is \"B\"");

else if(percentage>=70) // check condition for 70 and 79.

alert("your grade is \"C\"");

else if(percentage>=60) // check condition for 60 and 69.

alert("your grade is \"D\"");

else // check condition for less than 60.

alert("your grade is \"F\"");

Output:

  • If the user input 60, it will prints D.
  • If the user inputs 59, it will prints f.

Code Explanation:

  • The above code is in a javascript language, In which the first line is used to display the message and take the input from the user in the alert box.
  • Then the percentage is checked by the help of in if, else if and else statement and print the grade.
  • Then the grade is printed with the help of an alert box.
You might be interested in
Create a Rational number class in Java using the same style as the Complex number class created in class.(The in class example c
Elis [28]

Answer:

Explanation:

/*

*    This program adds, subtracts, multiplies, and divides two rational numbers.

*/

public class Main {

  //Main method

   public static void main(String[] args) {

       Rational a = new Rational(3, 4);   // input for first rational number

       Rational b = new Rational(2 , 5);   // input for second rational number

       System.out.println(a + " + " + b + " = " + a.add(b));

       System.out.println(a + " - " + b + " = " + a.sub(b));

       System.out.println(a + " * " + b + " = " + a.mul(b));

       System.out.println(a + " / " + b + " = " + a.div(b));

   }

}

class Rational {

   public Rational(int num, int den) {

      numerator = num;

      denominator = den;

     

      //ensures a non-zero denominator

      if (den == 0)

          den =1;

     

      //stores a negative sign in numerator

      if (den < 0) {

          num = num * -1;

          den = den * -1;

      }

   }

   //return numerator

   public int getNumerator() {

     

      return numerator;

   }

 

   //return denominator

   public int getDenominator() {

     

      return denominator;

   }

 

   //return reciprocal method

   public Rational reciprocal() {

     

      return new Rational(denominator, numerator);

   }

   /*   Addition Class

    *        Find common denominator by multiplying the denominators

    *        Store number values (numerator / common denominator) as num1 and num2

    *        Sum both numbers

    */

   public Rational add(Rational r2) {

      int comDen = denominator * r2.getDenominator();

      int num1 = numerator * r2.getDenominator();

      int num2 = r2.getNumerator() * denominator;

      int sum = num1 + num2;

      return new Rational (sum, comDen);

   }

   //Subtraction Class - same implementation as Addition Class

   public Rational sub(Rational r2) {

   

     int comDen = denominator * r2.getDenominator();

     int num1 = numerator * r2.getDenominator();

     int num2 = r2.getNumerator() * denominator;

     int difference = num1 - num2;

     return new Rational (difference, comDen);

  }

   

  /*   Multiplication Class

   *        Multiply numerator with r2 numerator

   *        Multiply denominator with r2 denominator

   */

  public Rational mul(Rational r2) {

   

     int num = numerator * r2.getNumerator();

     int den = denominator * r2.getDenominator();

     return new Rational (num, den);

  }

  /*   Divide Class

   *        Multiply number by r2 reciprocal

   */

  public Rational div(Rational r2) {

      return mul (r2.reciprocal());

  }

  /*   toString Method

   *        Returns rational number as a string - in parenthesis if a fraction

   */

  public String toString() {

     

      return (((numerator == 0) ? "0" : ( (denominator == 1) ? numerator + "": "(" + numerator + "/" + denominator + ")")));

 

      /* Logic for toString method

      * if (num == 0) {

              return "0";

          } else {

              if (denominator == 1){

                  return numerator;

              } else {

                  return numerator + "/" + denominator;

              }

      */

   }

  // Declare variables

  private int numerator, denominator;

 

}

output

(3/4) + (2/5) = (23/20)                                                                                                                                      

(3/4) - (2/5) = (7/20)                                                                                                                                      

(3/4) * (2/5) = (6/20)                                                                                                                                      

(3/4) / (2/5) = (15/8)                                                                                                                                      

6 0
3 years ago
which of the following is not a driver of wireless growth? group of answer choices universal access to information and applicati
AysviL [449]

The invention of the micro hard drive is not a driver of wireless growth.

What is Hard Drive (HDD)?

A computer hard drive (also known as a hard disk or HDD) is a type of technology that stores your computer's operating system, applications, and data files such as documents, pictures, and music. The rest of your computer's components work together to display the applications and files stored on ones hard drive.

How does a Hard Drive (HDD) work?

A hard disk drive (HDD) is made up of a platter with data storage compartments. This information includes your operating system, applications, and any files that you have created. There's also an accuator arm that keeps moving across the platter to read or write the data. The platter spins as the accuator arm movements across it to speed up the process.

To learn more about Hard Drive (HDD), visit: brainly.com/question/27269845

#SPJ4

6 0
1 year ago
Drag each tile to the correct box. Arrange the statements in sequence to correctly explain what the field of science includes. a
erastova [34]

These refer to the elementary steps of the scientific method.

The correct order is as follows:

  • Keen observation of natural phenomena.

  • The use of imagination and creativity to test understanding and predictions.

  • An attempt to verify the understanding of observed natural occurrences establishing verifiable scientific knowledge

  • Continued observance and testing to revise scientific knowledge.

  • An understanding of how or why these natural phenomena occur.

Learn more about the scientific methods at the link below:

brainly.com/question/497944

3 0
3 years ago
/*
Lera25 [3.4K]

Answer:

The answer to this question can be given as:

Method:

public static void showTwos(int number)  //method definition.

{

method body.  

System.out.print(number + " = ");  //print number

while (number % 2 == 0)   //condition

{

System.out.print("2 * ");    //print message.

number = number / 2;

}

System.out.println(number);    //print value.

}

Explanation:

In the above method definition firstly, we declare the method showTwos() that name is already given in the question then we pass a variable number as a parameter in the method. In this first, we take input number from the user and pass into this method. In this method we use a while loop it is an entry control loop in this loop first we modules the number if it is equal to 0.Then we divide the number by 2 and in the last, we print the value.

4 0
2 years ago
A function is a built-in formula in a spreadsheet. <br> a. True<br> b. False
Anna11 [10]
YES its TRUE the answer is A. true. Spreadsheet is like excel that contains built in formula and ready to use. You just have to explore more on its environment and research more about the spreadsheet so that your work will easily be done
5 0
3 years ago
Read 2 more answers
Other questions:
  • The analog signals that carry analog or digital data comprise composites built from combinations of simple sine waves.
    12·1 answer
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr
    11·1 answer
  • List and briefly defined categories of security services.
    8·1 answer
  • You're programming an infinite loop. What must you include in your code to prevent crashes?
    15·2 answers
  • Which of these is not the correct method for moving text in a document in Word 2016?
    14·2 answers
  • Write a SELECT statement that selects all of the columns for the catalog view that returns information about foreign keys. How m
    6·1 answer
  • 2. What is the name for an action performed by the VR Robot?
    7·2 answers
  • Nicotine us a dangerous chemical found in Cigarettes; it is accompanied by two other very harmful chemicals. These are
    15·1 answer
  • Identify the correct characteristics of Python tuples. Check all that apply.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!