Dear Student,
below i written the C++ code as per the requirement.
Please note the below program has been tested on ubuntu 16.04 system and compiled using g++ compiler. This code will also work on other IDE's
-----------------------------------------------------------------------------------------------------------------------------------
Program:
-----------------------------------------------------------------------------------------------------------------------------------
#include<iostream>
using namespace std;
int main()
{
int temp;
cout<<"Enter a temperature: ";
cin>>temp;
if(temp<32)
{
cout<<"Below Freezing"<<endl;
}
else
{
cout<<"Above Freezing"<<endl;
}
return 0;
}
==============================================================
Sample Output:
=================================================================
Kindly Check and Verify Thanks..!!!
Problem Write a C++program to 1- read a temperature, when entering a temperature from keyboard 2-...
Write a program in C that meets the following requirements: 1. Your program will read n + 1 integers from the keyboard where n is the first integer read. 2. If n is less than 1 print an error message and return a status of 1. 3. If there are no positive numbers, print “no positive numbers”. This is not an error. 4. If there are positive numbers, print the average of the positive numbers. 5. 0 is neither positive...
C language 2. Write a program to read in a string from the keyboard and only display the vowels and their positions index) in a table format. Enter a string: This is a test Here are the vowels and their positions:
Program : Write a complete C++ program that Input: Read a positive integer from the keyboard (user) with proper prompt text and save it to a variable. The integer have up to five digits. Processing: From the right most digit, extract every digit from the input integer using modular operator %then save the digit to a separate variable. Remove the right most digit from the integer using integer division operator /. Repeat above two steps till all digits have been...
write a C program to read in a string from the keyboard and display the whole string backward
Problem 1: Complete this truth Table. Write a program that you can enter from the keyboard,a 1 or 0 into three Boolean variables, A,B,C. Write an if statement that tests the condition ( (A or B ) and C ). Run the program 8 separate times, testing each of the following 8 combinations. Write the results below in the following truth table: Problem 1-Complete this truth Table. Write a program that you can enter from the keyboard, a 1 or...
In C, write a program to read 5 student scores from keyboard the average of test score. Use for loop. Instead of entering the 5 scores each time you run the program, you can use i/o redirect. Create an input file inputfor.txt, then add 5 scores in it. Run the command like this: scorefor < inputfor.txt
Write a MARIE assembly program to read two different positive numbers from the keyboard and output the smaller number to the screen.
Write a program in C++ that will read a sentence from the keyboard, terminated with a period '.' and write the sentence to an output file with all white spaces replaced by the symbol '*'. You may use the “isspace()” function of the “cctype” library to carry out the determination of whether the character read is 'white space'. Show any #include files you may need. Make sure to handle conditions where the file may be missing so your program does...
(Statistics) a. Write a C++ program that reads a list of double-precision scores from the keyboard into an array named scores. It is assumed that the user will enter no more than 35 scores. The scores are to be counted as they're read, and entry is to be terminated when a negative value has been entered. After all scores have been input, your program should find and display the sum and average of the scores. The scores should then be...
Write a program that inputs up to 100 real numbers from the keyboard (one at a time). When a number greater than 1.0e9 is input the keyboard input will stop. Then the following statistic for the input data will be computed and printed out to the screen. a) average b) standard deviation c) minimum value d) maximum value e) range = (maximum-minimum)/2 f) the number of times zero is input **Note: this is a program in C++** 3) Write a...