
Recap Week
Presentation
•
Computers
•
University
•
Hard
nurul iman
FREE Resource
4 Slides • 0 Questions
1
Let's recap with C++ coding
2
Based on coding shown, what header that should be use?
int main() {
double x = 4.5;
double squareRoot = sqrt(x);
double cosineValue = cos(x);
cout << "Square root of " << x << " is " << squareRoot << endl;
cout << "Cosine of " << x << " is " << cosineValue << endl;
char ch = 'A';
bool isUpper = isupper(ch);
bool isDigit = isdigit(ch);
cout << ch << " is uppercase? " << boolalpha << isUpper << endl;
cout << ch << " is a digit? " << boolalpha << isDigit << endl;
return 0;
}
3
Create a C++ coding that create a menu using function
4
// Function to display the menu options
void displayMenu() {
cout << "=== Menu ===" << endl;
cout << "1. Option 1" << endl;
cout << "2. Option 2" << endl;
cout << "3. Option 3" << endl;
cout << "4. Quit" << endl;
cout << "=============" << endl;
}
Function
int main() {
int choice;
do {
displayMenu();
cout << "Enter your choice (1-4): ";
cin >> choice;
switch (choice) {
case 1: cout << "You selected Option 1." << endl; break;
case 2: cout << "You selected Option 2." << endl; break;
case 3: cout << "You selected Option 3." << endl; break;
case 4: cout << "Quitting the program." << endl; break;
default: cout << "Invalid choice. Please try again." << endl; break;
}
cout << endl;
} while (choice != 4); return 0; }
Main Function
Example code:
Let's recap with C++ coding
Show answer
Auto Play
Slide 1 / 4
SLIDE
Similar Resources on Wayground
4 questions
Word básico
Presentation
•
KG - University
4 questions
Theory Stars Workshop Day 1 (Challenge 1)
Presentation
•
KG
2 questions
Multiple Choice CR3
Presentation
•
12th Grade
8 questions
Лекция на тему: "Что такое html и зачем он нужен?"
Presentation
•
University
7 questions
ALGO
Presentation
•
12th Grade
7 questions
Baby, Baby, Baby!!!!
Presentation
•
University
7 questions
BBHR2003 Tutorial 1
Presentation
•
University
7 questions
Distancias de seguridad a Líneas Eléctricas
Presentation
•
University
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Assessment 1
Quiz
•
3rd Grade
15 questions
HCS SCI 05 Summer School Assessment 1 Review
Quiz
•
5th Grade
22 questions
Day 9 Equations and Inequalities Review
Quiz
•
9th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
7 questions
PYRAMID PERSPECTIVES part 1
Presentation
•
9th - 12th Grade
12 questions
Understanding the Fourth of July
Quiz
•
9th Grade
15 questions
Soccer World Cup Quiz Questions
Quiz
•
7th Grade