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
Write a function named "isValidPassword" that takes in a string and returns 1 if it stores a valid password and 0 otherwise, A v
Maslowich

Answer:

Here is code in java.

import java.util.*;

import java.lang.*;

import java.io.*;

class Solution

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

   //declare and initialize string variables

       String str1="password";

       String str2="Pass_word";

    //calling function to check valid password

       System.out.println("output of password is: "+isValidPassword(str1));

        System.out.println("output of Pass_word is: "+isValidPassword(str2));

   }catch(Exception ex){

       return;}

}

// functionn to check the valid password

public  static int isValidPassword(String str)

{

// variables to count the lower,upper and non character

  int i, lower_c = 0, upper_c = 0, non_c = 0;

  char ch;

  for(i=0;i<str.length();i++)

  {

      ch = str.charAt(i);

     if(ch >= 'a' && ch <= 'z')

     {//count of lower character

        lower_c++;

     }

     else if(ch >= 'A' && ch <= 'Z')

     {

   //count of upper character

        upper_c++;

     }

     else

     {

   //count of non character

        non_c++;

     }

  }

  if(lower_c > 0 && upper_c > 0 && non_c > 0) {

     return 1;

  } else {

     return 0;

  }

}

}

Explanation:

Declare and initialize two string variables.In the isValidPassword() function, pass the string parameter and then count the lower, upper and non character in the string.If string contains call the three characters then function will return 1 otherwise it will return 0 .

Output:

output of password is: 0

output of Pass_word is: 1

8 0
3 years ago
2. Create a file with the follow integer/string content and save it as fun.txt. 6 fun. 3 hello 10 &lt;&gt; 2 25 4 wow! Write an
Nesterboy [21]

Answer:

see explaination

Explanation:

I made use of python program to solve this.

text file name with fun.txt.

6 fun. 3 hello 10 <> 2 25 4 wow!

Program code:

import re

file = open('fun.txt','r') #for reading file

strings="" #declaring empty string

for k in file:

strings=strings+k #all character in file is storing in strings variable for do operations

pattern = '\s' #for pattern \s is for space

result = re.split(pattern, strings) #split the string with space

for k in range(len(result)): #loop through the list of string

if(k%2) == 0: #checking for integer to time of string

p=int(result[k])

print(result[k+1] *p) #print times of the string(k+1)

Check attachment for output

8 0
3 years ago
To view the Picture tools tab, a user must first _____.
Amiraneli [1.4K]
Answer: A select the picture
8 0
3 years ago
Read 2 more answers
PLS HELP
kvasek [131]

Answer:

informative, discrimiitive,critical thats the order

4 0
3 years ago
George has to present the goals of information management to his team member. What is a goal of information management? The goal
Law Incorporation [45]

Answer:

The purpose of information management is to: design, develop, manage, and use information with insight and innovation. support decision making and create value for individuals, organizations, communities, and societies.

Explanation:

5 0
3 years ago
Other questions:
  • The programs that provide the infrastructure and hardware control necessary for the computer and its peripheral devices are call
    11·1 answer
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • Which screen should be open to customize or personalize a desktop background?
    15·2 answers
  • Can you awnser this question
    15·1 answer
  • What do we call data that's broken down into bits and sent through a network?
    15·1 answer
  • Giải thích mục đích của các thao tác open() và close().
    6·2 answers
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    13·1 answer
  • Write the features of Mark-I.​
    7·1 answer
  • How do you enlarge an image to see more detail on it? (1 point)
    14·2 answers
  • The residual volume can be measured directly with: Select an answer and submit. For keyboard navigation, use the up/down arrow k
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!