Link to install Visual Studio with C++:
https://youtu.be/ThmtfSdKuGo
C++ for Beginner@Lesson 5: Making Decisions
https://www.youtube.com/watch?v=0sMO4s6_YAU
Questions:
1) Design an algorithm (with a flowchart) for the following table to decide the activity based on outdoor temperature. Then write a C++ program accordingly.
Activity Temperature (celcius)
Swimming temperature more than 35
Koraoke temperature between 32 and 35
Shopping temperature between 28 and 32
Football temperature between 25 and 28
Workout temperature less or equal than 25
2) Write a switch statement that will examine the value of an integer variable called flag and print one of the following messages, depending on the value assigned to flag.
(a) HOT, if flag has a value of 1,
(b) WARM, if flag has a value of 2,
(c) COLD, if flag has a value of 3,
(d) OUT OF RANGE, if flag has any other value.
Download
0 formats
No download links available.
Practical@Lesson 5: Multiple selection: else-if VS switch in C++ | NatokHD