Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. First image is my attempt , second without

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
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. First image is my attempt , second without
e
2002
Homepage - Southern New Ham X
https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4
F2
boks My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches
468126.2601242.qx3zqy7
Jump to level 1
Type here to search
X
F3
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000.
Ex: If the input is 1000 450, then the output is:
1000
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5
6
7
8
9
10
11
12
13
14
15
16 }
int userVal;
int maxVal;
cin >> userVal;
cin >> maxVal;
cout << maxVal << endl;
return 0;
1
F4
Bi
1 2-1 zyBooks Participation Activiti X
I
F5
C
41
F6
2
zy Section 3.4- CS 210: Programmir X
F7
F8
3
F9
EzyBooks cata
F10
+
4
F
Transcribed Image Text:e 2002 Homepage - Southern New Ham X https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4 F2 boks My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches 468126.2601242.qx3zqy7 Jump to level 1 Type here to search X F3 Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. Ex: If the input is 1000 450, then the output is: 1000 1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12 13 14 15 16 } int userVal; int maxVal; cin >> userVal; cin >> maxVal; cout << maxVal << endl; return 0; 1 F4 Bi 1 2-1 zyBooks Participation Activiti X I F5 C 41 F6 2 zy Section 3.4- CS 210: Programmir X F7 F8 3 F9 EzyBooks cata F10 + 4 F
Homepage - Southern New Ham X
https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4
468126.2601242.qx3zqy7
My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches
e to search
X
Jump to level 1
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5 int userval;
6
int maxVal;
7
8
9
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000.
Ex: If the input is 1000 450, then the output is:
1000
10
11
12
13
14
15
16
17 }
Check
cin >> userVal;
cin >> maxVal;
if (userVal<- 1000) {
cout << "1000"<< endl;
}
cout << maxVal << endl;
2-1 zyBooks Participation Activiti X
return 0;
1
Et
zy Section 3.4 - CS 210: Programmir X
2
EzyBooks cat
3
Transcribed Image Text:Homepage - Southern New Ham X https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4 468126.2601242.qx3zqy7 My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches e to search X Jump to level 1 1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 int userval; 6 int maxVal; 7 8 9 Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. Ex: If the input is 1000 450, then the output is: 1000 10 11 12 13 14 15 16 17 } Check cin >> userVal; cin >> maxVal; if (userVal<- 1000) { cout << "1000"<< endl; } cout << maxVal << endl; 2-1 zyBooks Participation Activiti X return 0; 1 Et zy Section 3.4 - CS 210: Programmir X 2 EzyBooks cat 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Image Element
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