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
Veronika [31]
4 years ago
5

What will the following segment of code output? Assume the user enters a grade of 90 from the keyboard. cout << "Enter a t

est score: "; cin >> test_score;
Computers and Technology
1 answer:
inysia [295]4 years ago
5 0

Complete Question:

What will the following segment of code output?

Assume the user enters a grade of 90 from the keyboard.

cout << "Enter a test score: ";

cin >> test_score;

if (test_score < 60);

cout << "You failed the test!" << endl;

if (test_score > 60)

cout << "You passed the test!" << endl;

else

cout << "You need to study for the next test!";

Answer:

You failed the test!

You passed the test!

Explanation:

With the assumption that test_score has been declared as an int variable

The output of: You failed the test! You passed the test! May be unexpected since the test_score is greater than 90 so it looks like the code has a logical error somewhere.

This error is as a result of putting a semi colon at then end of the first if statement if (test_score < 60);

An if statement does not end a thought as such there should'nt be a semi colon ending it. Take the semi-colon out and the program will give the expected output of You passed the test! since test_score of 90 is greater than 60

You might be interested in
PLS HELP ASAP ILL GIVE BRAINLKEST THANKS ITS FOR TODAY
ANTONII [103]
Do u have context for the question? Based off of my brain alone, I would eliminate good food as an answer. I’d assume the answer to the second question is code.
8 0
3 years ago
Who invented the program HTML?
kondaur [170]
In 1980, physicist Tim Berners-Lee<span>, a contractor at </span>CERN<span>, proposed and prototyped </span>ENQUIRE<span>, a system for CERN researchers to use and share documents. In 1989, Berners-Lee wrote a memo proposing an </span>Internet<span>-based </span>hypertext<span> system.</span>[3]<span> Berners-Lee specified HTML and wrote the browser and server software in late 1990. That year, Berners-Lee and CERN data systems engineer </span>Robert Cailliau<span> collaborated on a joint request for funding, but the project was not formally adopted by CERN. In his personal notes</span>[4]<span> from 1990 he listed</span>[5]<span> "some of the many areas in which hypertext is used" and put an encyclopedia first.</span>
8 0
3 years ago
Read 2 more answers
Which is the highest in complexity?
Scorpion4ik [409]

Answer:

B. (n2) * n.

Explanation:

The highest complexity is (n2)*n because on solving it will come out to be n³.So the growth rate is of cubical order which is the highest among the options.

(n) * 2n is of the order of square.On solving it will be 2n².

n² is also of the order of square.

nlogn complexity is less than n² but greater than n.

3n is of linear complexity.It has the lowest complexity among the options.

6 0
3 years ago
What does a sperm cell plus egg cell equal in total?
Lena [83]

A sperm cell plus an egg cell equals an embryo

7 0
4 years ago
What is cloud computing,the wireless revolution,and IoT
Crazy boy [7]

Cloud Computing in IoT works as part of a collaboration and is used to store IoT data. The Cloud is a centralised server containing computer resources that can be accessed whenever required. Cloud Computing is an easy travel method for the large data packages generated by the IoT through the Internet.

7 0
2 years ago
Other questions:
  • What protocol must be supported by routers in order to utilize remote assistance easy connect?
    10·1 answer
  • What are the main types of software? Explain with appropriate examplesWhat are the main types of software? Explain with appropri
    12·2 answers
  • Technician A says that high pressure in recycled refrigerant is only caused by air contamination. Technician B says that recycle
    15·1 answer
  • 4.3 Code Practice<br> edhisve
    13·1 answer
  • A(n) _______ is a distributed networking architecture, residing on one or more computers, where one program requests a resource
    14·1 answer
  • Write a C++ program that reads a temperature value and the letter C for Celsius or F for Fahrenheit. Print whether water is liqu
    14·1 answer
  • Use of the Internet for e-government has increased. Identify the benefits by checking all of the boxes that apply.
    8·1 answer
  • Can someone help me on a 60 second ringtone :(
    9·1 answer
  • The table below describes the planting method used for some vegetables. Which field in this table can you define as the primary
    9·2 answers
  • Evaluate the advantages and disadvantages of cloud computing.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!