Objectives By completing this lab, studonts should be able to. • Write programs using conditional operatorS • Write programs using logical expressions • Write programs using getline () Background Relational operators allow you to compare numerie, charactor, and string valucs to determine whether ome is greater than, less than, equal to, or not equal to another. A relatiomal expressioın evaluates one or more variables using relational operators to arrive at a Boolean (true or falve) outeome. Consider the fallowing relational operators and expresion: Relational Operator Relational Expression Meaning x grester hun y bx les than y Iax grester thun or oual a y lax les than or equal to y! Isx oqual to y Isx not equai to y Control structures are commands used in C++ to control the hehavior of a program based on certain eriteria, such as user input. In this luh, you are heing intraduced to the "i" statement. There ure three different uses ofthe ": f" statement in C- if, it/alne, und iflelso-if/alse. In their basic form, the following skeleton code templates implement these statements: if (re'ational axprassiori /* Execate Laia code il the rela.ional expresaion la tre */ if frelationsl expreasian) /* Execute code here it the expression is true / * Execule cude heze 1E Lhe expreusion iu faise */ If (selational expreasion 11 /A Exacuta oode rare if axpresaton s true / else if trelational expression 2) /* Execute code here if expzession 2 is true / else /* Execute code here if ALL expressions are false /
Objectives By completing this lab, studonts should be able to. • Write programs using conditional operatorS • Write programs using logical expressions • Write programs using getline () Background Relational operators allow you to compare numerie, charactor, and string valucs to determine whether ome is greater than, less than, equal to, or not equal to another. A relatiomal expressioın evaluates one or more variables using relational operators to arrive at a Boolean (true or falve) outeome. Consider the fallowing relational operators and expresion: Relational Operator Relational Expression Meaning x grester hun y bx les than y Iax grester thun or oual a y lax les than or equal to y! Isx oqual to y Isx not equai to y Control structures are commands used in C++ to control the hehavior of a program based on certain eriteria, such as user input. In this luh, you are heing intraduced to the "i" statement. There ure three different uses ofthe ": f" statement in C- if, it/alne, und iflelso-if/alse. In their basic form, the following skeleton code templates implement these statements: if (re'ational axprassiori /* Execate Laia code il the rela.ional expresaion la tre */ if frelationsl expreasian) /* Execute code here it the expression is true / * Execule cude heze 1E Lhe expreusion iu faise */ If (selational expreasion 11 /A Exacuta oode rare if axpresaton s true / else if trelational expression 2) /* Execute code here if expzession 2 is true / else /* Execute code here if ALL expressions are false /
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please provide a code that runs in visual studio with the output.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 5 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY