answer.
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
hammer [34]
2 years ago
9

The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el

seif-else statement that displays the letter grade (any format) corresponding to a numerical grade in an appropriately formatted output statement. Use the standard 10-point grading scale:  a: A: 90 ≤ grade  a: B: 80 ≤ grade < 90  a: C: 70 ≤ grade < 80  a: D: 60 ≤ grade < 70  a: F: grade < 60
Computers and Technology
1 answer:
Alborosie2 years ago
8 0

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

int main()

{

float marks;

cout<<"Enter your grade value :";

cin>>marks;

if(marks>=90)

cout<<"Your grade is 'A'";

else if(marks>=80&& marks<90)

cout<<"Your grade is 'B'";

else if(marks>=70&& marks <=80)

cout<<"Your grade is 'C'";

else if(marks>=60&& marks <70)

cout<<"Your grade is 'D'";

else

cout<<"Your grade is 'F'";

}

You might be interested in
Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69
Xelga [282]

Answer:

Explanation:

The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW

//Entire code is in text file attached below.

//MY CODE HERE

       DecimalFormat df = new DecimalFormat("0.00");

       oranges.setPrice(10, 2.99);

       oranges.setNumberBought(2*12);

       eggs.setPrice(12, 1.69);

       eggs.setNumberBought(2*12);

       apples.setPrice(3, 1);

       apples.setNumberBought(20);

       watermelons.setPrice(1, 4.39);

       watermelons.setNumberBought(2);

       bagels.setPrice(6, 3.50);

       bagels.setNumberBought(12);

       totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();

       System.out.println("Total Cost: $" + df.format(totalCost));

   }

}

5 0
2 years ago
Show how the recursive multiplication algorithm computes XY, where X = 1234 and Y = 4321. Include all recursive computations.
lozanna [386]

Answer:

The result of recursive multiplication algorithm is 5332114 . Here karatsuba algorithm with recursive approach is used to compute XY where X = 1234 and Y = 4321.

Explanation:

The steps for karatsuba algorithm with recursive approach:

base case:

if(X<10) or (Y<10) then multiply X with Y

For example if X is 1 and Y is 2. Then XY = 1*2 = 2

Recursive case:

Now when the above if condition is not true then follow these steps to compute XY

Compute the size of numbers.

Notice that there are 4 digits in X i.e. 1 2 3 4 and a 4 digits in Y i.e. 4 3 2 1

So n = 4

Now divide the numbers in 2 parts as:

n/2 = 4/2 = 2

Since these are decimal numbers so we can write it as:

10^n/2

Now split the digits

X = 1234 is divided into 2 parts as:

12 and 34

Let a represent the first part and b represent the second part of X. So,

a = 12

b = 34

Y = 4321 is divided into 2 parts as:

43 and 21

Let c represent the first part and d represent the second part of Y. So,

c = 43

d = 21

Let multiplication reprsents the karatsuba recursive multiplication algorithm

Now recursively compute products of inputs of size n/2  

   multiplication (a, c)

   multiplication (b, d)

   multiplication (add(a, b), add(c, d))  

  Combine the above 3 products to compute XY  

As we know these decimal numbers have base 10 and X and Y are divided into two parts So X can be written as:

X = 10^{\frac{n}{2} }  a+b

Y can be written as:

Y = 10^{\frac{n}{2} }  c+d

Now compute XY as:

XY = (10^{\frac{n}{2} }  a+b) ( 10^{\frac{n}{2} }  c+d)

XY = 10^{\frac{2n}{2} }  ac + 10^{\frac{n}{2} }  ad +  10^{\frac{n}{2} }  bc + bd

     =  10^{n}  ac + 10^{\frac{n}{2} } (ad + bc) + bd

Now put the values of n = 4, a = 12, b = 34 , c = 43 and d = 21

      = 10⁴ (12*43) + 10² (12*21 + 34*43) + (34*21)

      = 10⁴ (516) + 10² (252 + 1462) + 714

      = 10000*516 + 100*1714 + 714

      = 5160000 + 171400 + 714

XY  = 5332114

Hence the karatsuba multiplication algorithm with recursive appraoch computes XY = 5332114

3 0
2 years ago
Consider the following class:
levacccp [35]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The super is a keyword in java which is used to call the parent class constructor from the child class constructor, but the only one thing is important to write the super is the constructor that the super keyword needs to be written as a first-line where it is used.
  • The above question has three option which holds the constructor, in which option 1 and 2 holds the super keyword as the last line. So this option is not to hold the correct constructor.
  • But option 3 will hold the Super as the first line, Hence this is the correct use of the constructor.
  • And Only option c states about option 3 while the other is states about the other option. Hence option c is the correct answer.
4 0
2 years ago
Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
kolbaska11 [484]

Answer: Decoupling action of the process address space refers to the physical memory of the device getting decoupled to provide  address translation in automatic way. The benefit of this method is as follows:-

  • Faster starting up of the program
  • The physical address space gets managed on its own
  • Helps in execution of large program when the main memory of the machine is of  smaller size in comparison with program

7 0
2 years ago
Write a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher. The script
jenyasd209 [6]

Answer:

# Request the inputs

codedText = input("Enter the coded text: ")

distance = int(input("Enter the distance value: "))

# Calculate the decryption

# see comment for the rest. Brainly won't let me save an answer which contains code.

Explanation:

Above is your program fixed, but it is unclear on how to deal with unprintable characters, i.e., characters that originally were near the highest printable character ('~')

4 0
2 years ago
Other questions:
  • Which of the following is not one of the four methods for classifying the various instances of malware by using the primary trai
    9·1 answer
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • The attack in which the attacker sends a forged packet with the same source IP address and destination IP address in which the v
    10·1 answer
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the
    8·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
  • Why do agriculture and natural resource systems vary from state to state?
    8·1 answer
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • What is Accenture's role in Multi-party Systems?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!