
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
3 questions
Tool Box dan Option Bar
Presentation
•
Professional Development
7 questions
ΕΠΕΞΕΡΓΑΣΙΑ ΚΕΙΜΕΝΟΥ-ΠΛΗΚΤΡΟΛΟΓΙΟ
Presentation
•
12th Grade
5 questions
Preguntas con qué y cuál
Presentation
•
University
7 questions
SENTENCE COMPLETION
Presentation
•
University
7 questions
Innovación Educativa
Presentation
•
University
7 questions
Using abbreviations and symbols
Presentation
•
KG - University
6 questions
Tech Showcase
Presentation
•
University
3 questions
LATIHAN DISTRIBUSI NORMAL
Presentation
•
12th Grade
Popular Resources on Wayground
19 questions
Naming Polygons
Quiz
•
3rd Grade
10 questions
Prime Factorization
Quiz
•
6th Grade
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
Discover more resources for Computers
50 questions
ELA EOG Prep 7th Grade
Quiz
•
KG - University
20 questions
Guess The App
Quiz
•
KG - Professional Dev...
11 questions
dog breeds
Quiz
•
3rd Grade - Professio...
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
19 questions
Minecraft
Quiz
•
6th Grade - Professio...
20 questions
Block Buster Movies
Quiz
•
10th Grade - Professi...
10 questions
Would you rather...
Quiz
•
KG - University
49 questions
AP Environmental Science Final Exam Review
Quiz
•
10th Grade - University