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
wlad13 [49]
4 years ago
14

Create a variable ‘temp’ and assign the value in Celsius. Display the message ‘It’s extremely hot day today!’ if the temperature

is greater than 40oC otherwise, displays ‘It’s not too hot!
Computers and Technology
1 answer:
Likurg_2 [28]4 years ago
3 0

Answer:

This code is written using C++

Comments are used for explanatory purpose

Program starts here

#include<iostream>

using namespace std;

int main() {

int temp;

//Prompt user for input

cout<<"Enter temperature (in Celcius): ";

//Check if input is acceptable

while(!(cin>>temp)) {

cout << "That was invalid. Enter a valid digit: "<<endl;

cin.clear(); // reset the failed input

cin.ignore(123,'\n');//Discard previous input

}

//Check if temp is greater than 40

if(temp>40) {

cout<<"It's extremely hot day today!";

}

else{//If otherwise

cout<<"It's not too hot!";

}

return 0;

}

//End of Program

You might be interested in
A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is
Vinil7 [7]

Answer:

The correct option is 1 as the overflow error has occurred

Explanation:

As the program uses 3 bits to represent integers thus the range of the maximum value that the program can store is given as

2^2+2^1+2^0=4+2+1=7

So when the two numbers in decimal base 10 are added as 3 and 5 the resultant is given as

3=(011)_2\\5=(101)_2\\\_\_\_\_\_\_\_\_\_\_\_\_\\8=(1000)_2

This is more than what the 3 bit integer can store thus the overflow error has occurred.

3 0
4 years ago
Engineers perform a(n) blank to compare the possible negative effects of making a decision involving technology with the possibl
Bumek [7]

Answer: Experiment.

Explanation:

4 0
3 years ago
Read 2 more answers
What pointer appears when pointing to a hyperlink
Leokris [45]
Your answer would be: a hand pointer.
6 0
3 years ago
Read 2 more answers
In which two ways do extras function in a drama
timofeeve [1]
They don't speak and normally referred to by their job.
3 0
3 years ago
What is an input and output device? Give examples.​
yanalaym [24]

Answer:

input devices are a piece of equipment used to provide data to the computer examples:  mouse, keyboard, scanner, camera, etc

output devices are any piece of computer hardware equipment which converts information into a human readable form examples: printer, monitor, and others

6 0
3 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • Tool such as microsoft’s ____ are helping to bridge different platforms and programming languages.
    6·1 answer
  • Max Weber's concept of ________ implies that, in conducting research, social scientists must try to understand others' view of r
    14·2 answers
  • Which kinds of Internet content do you think you need permission to use? Check all that apply.
    8·2 answers
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA.
    13·1 answer
  • How Do I Make A Walk animation for a school Project?? Gifs?
    13·1 answer
  • A router is a peripheral that may need troubleshooting if the network goes down.
    12·2 answers
  • Which staff member takes a set of plans and supervises their construction?
    6·1 answer
  • Name of the electrical tool and their classification
    10·1 answer
  • Can rank u r guys in rocket leagye
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!