Oel #2pf Lab Spring 2023.
Oel #2pf Lab Spring 2023.
%age Marks out of 100: 6 % Open Ended Lab #2 %age Marks Obtained:
Student Name: TEACHER: Activity Date: 7-9-23
Student ID: Engr. Shafique Ahmed Soomro Due Date:14-9-23
Problem Complexity (WP/EP): WP-1 COURSE CODE) & TITLE: SEMESTER: 2nd semester
Knowledge Area / Sub Area (WK): WK-2 (EE-121A) OFFERED IN: Spring 2023
Washington Accord Attribute (WA): WA- Programming Fundamentals Lab FOR THE BATCH: Fall 22
5,9
OBE Attainment (Course): OBE Attainment Taxonomy): OBE Attainment (Program):
Course Learning Outcomes(CLO): Domain: Cognitive Program Learning Outcome ( PLO)
CLO-1 Level: P-3 PLO: 5
CLO Statement:
Objective: create a C++ program that allows the user to play a "Guess the Number" game with
the computer.
OPEN ENDED LAB PERFORMANCE
3 Discussion of output/ The output is correct for a variety of The output is correct for a The output are incorrect for any input
/Simulation input in terms of input parameters few specific input but not parameters rating
rating able to deal with all types of
inputs parameters rating
Total Marks: 6
Remarks:
Department of Electrical Engineering, FEST, Indus University, Karachi
Instructions/Steps
1. Begin by setting up a new C++ project in your preferred development environment.
2. Write the code for the "Guess the Number" game, following the requirements and bonus challenges
as desired.
3. Test your program thoroughly to ensure it works correctly, handles user input gracefully, and
provides appropriate feedback.
4. Encourage students to be creative in how they implement the game and to comment their code well
for clarity.
5. Provide students with opportunities to showcase their programs to the class and discuss their
approaches and any challenges they encountered.
Deliverables:
Algorithm
Pseudo Code
Complete Code
Output Screen
Report
Presentation
1. he program should generate a random number between 1 and 100 and store it as the target number.
2. The program should provide the user with a limited number of attempts (e.g., 5) to guess the target number.
Check if the guess is correct, too high, or too low compared to the target number.
4. The program should keep track of the number of attempts made by the user and display this information after
each guess.
5. If the user correctly guesses the number within the allowed number of attempts, the program should
congratulate them and display the number of attempts it took.
6. If the user exhausts all their attempts without guessing the correct number, the program should reveal the target
number and inform the user that they have lost.
7. The program should include error handling for invalid user input (e.g., non-numeric input or out-of-range
guesses).
Attributes Description