3.2.2: Read and format integers. Jump to level 1 First, read in an input value for variable inputCount. Then, read inputCount integers from input and output each integer on a newline followed by the string " entries.". Ex: If the input is 3 35 5 90, the output is: 35 entries. 5 entries. 90 entries. #include using namespace std; int main() { int inputCount; int i = 0; for (i = 0; i < 4; ++i) { cin >> inputCount; cout << inputCount << " entries." << endl; } return 0; } Input 3 35 5 90 Your output 3 entries. 35 entries. 5 entries. 90 entries. Expected output 35 entries. 5 entries. 90 entries. clear2: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 1 100 Your output 1entries.100 entries. 100entries.100entries. Expected output 100 entries. clear3: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 6 65 10 40 70 50 20 Your output 6 entries. 65 entries. 10 entries. 40 entries. Expected output 65 entries. 10 entries. 40 entries. 70 entries. 50entries.20entries. clear4: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 5 -5 80 15 -35 -80 Your output 5 entries. -5 entries. 80 entries. 15 entries. Expected output -5 entries. 80 entries. 15 entries. -35 entries. -80entries. clear5: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 6 -55 -5 -95 -35 -25 -75 Your output 6 entries. -55 entries. -5 entries. -95 entries. Expected output -55 entries. -5 entries. -95 entries. -35 entries. -25 entries. -75 entries.
3.2.2: Read and format integers. Jump to level 1 First, read in an input value for variable inputCount. Then, read inputCount integers from input and output each integer on a newline followed by the string " entries.". Ex: If the input is 3 35 5 90, the output is: 35 entries. 5 entries. 90 entries. #include using namespace std; int main() { int inputCount; int i = 0; for (i = 0; i < 4; ++i) { cin >> inputCount; cout << inputCount << " entries." << endl; } return 0; } Input 3 35 5 90 Your output 3 entries. 35 entries. 5 entries. 90 entries. Expected output 35 entries. 5 entries. 90 entries. clear2: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 1 100 Your output 1entries.100 entries. 100entries.100entries. Expected output 100 entries. clear3: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 6 65 10 40 70 50 20 Your output 6 entries. 65 entries. 10 entries. 40 entries. Expected output 65 entries. 10 entries. 40 entries. 70 entries. 50entries.20entries. clear4: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 5 -5 80 15 -35 -80 Your output 5 entries. -5 entries. 80 entries. 15 entries. Expected output -5 entries. 80 entries. 15 entries. -35 entries. -80entries. clear5: Compare outputkeyboard_arrow_up Output differs. See highlights below. Special character legend Input 6 -55 -5 -95 -35 -25 -75 Your output 6 entries. -55 entries. -5 entries. -95 entries. Expected output -55 entries. -5 entries. -95 entries. -35 entries. -25 entries. -75 entries.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
3.2.2: Read and format integers.
Jump to level 1
First, read in an input value for variable inputCount. Then, read inputCount integers from input and output each integer on a newline followed by the string " entries.".
Ex: If the input is 3 35 5 90, the output is:
35 entries.5 entries.
90 entries.
#include <iostream>
using namespace std;
int main() {
int inputCount;
int i = 0;
for (i = 0; i < 4; ++i) {
cin >> inputCount;
cout << inputCount << " entries." << endl;
}
return 0;
}
Input
3 35 5 90
Your output
3 entries.
35 entries.
5 entries.
90 entries.
Expected output
35 entries.
5 entries.
90 entries.
clear2: Compare outputkeyboard_arrow_up
Output differs. See highlights below. Special character legend
Input
1 100
Your output
1entries.100 entries. 100entries.100entries.
Expected output
100 entries.
clear3: Compare outputkeyboard_arrow_up
Output differs. See highlights below. Special character legend
Input
6 65 10 40 70 50 20
Your output
6 entries. 65 entries. 10 entries. 40 entries.
Expected output
65 entries. 10 entries. 40 entries. 70 entries. 50entries.20entries.
clear4: Compare outputkeyboard_arrow_up
Output differs. See highlights below. Special character legend
Input
5 -5 80 15 -35 -80
Your output
5 entries. -5 entries. 80 entries. 15 entries.
Expected output
-5 entries. 80 entries. 15 entries. -35 entries. -80entries.
clear5: Compare outputkeyboard_arrow_up
Output differs. See highlights below. Special character legend
Input
6 -55 -5 -95 -35 -25 -75
Your output
6 entries. -55 entries. -5 entries. -95 entries.
Expected output
-55 entries. -5 entries. -95 entries. -35 entries. -25 entries. -75 entries.
Expert Solution
Step 1
The C++ code is given below with output screenshot
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images