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
icon
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

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education