0% found this document useful (0 votes)
18 views15 pages

Cea Report

This document summarizes a university system created using C++ that has three modes: a teacher portal, university cafe, and gaming zone. The teacher portal allows calculating student final marks and grades using concepts like dynamic memory allocation, functions, loops, and file handling. The university cafe displays a menu for purchasing food items using switches and loops. The document explains the key concepts used like functions, dynamic memory allocation, loops, file handling, switches, and if/else statements providing examples from the program. It also includes outputs from the teacher portal and cafe modes.

Uploaded by

Hammad Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views15 pages

Cea Report

This document summarizes a university system created using C++ that has three modes: a teacher portal, university cafe, and gaming zone. The teacher portal allows calculating student final marks and grades using concepts like dynamic memory allocation, functions, loops, and file handling. The university cafe displays a menu for purchasing food items using switches and loops. The document explains the key concepts used like functions, dynamic memory allocation, loops, file handling, switches, and if/else statements providing examples from the program. It also includes outputs from the teacher portal and cafe modes.

Uploaded by

Hammad Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

M

Complex Engineering Activity


OF CP LAB

TITLE: UNIVERSITY SOFTWARE USING IN C++

NAME OF GROUP MEMBERS


MUNEEB AHMED 210578
MUSAWIR ALI 210532
HAMMAD HASSAN 210596
INTRODUCTION
In this complex engineering problem we created a university system
using C++. This university has three modes. Each mode as its own
function name after their function. The modes in this university
system are given below.

− TEACHER PORTAL : In teacher portal, we calculate final


marks and grade of the student by using different concepts in c+
+. i.e. dynamic memory allocation, function, loops and file
handling which makes our work easy and time saving. We keep
our code generic by using dynamic memory allocation so it is
used for as much students they want to calculate the grade. As
per instruction of CEA we calculate it for 5 students. But if we
want we can calculate for much students as we like. First, we
display the names of students enrolled in the program by using
file handling. Then we provide user to select the grading type i.e.
Lab report, Lab performance and others and then finally the user
will able to enter the marks of each grading type and it also
provide option to assign weightage for each grading type. After
getting all the needed information for calculating the final marks
we use simple formula to calculate final marks and grade of the
students.

− UNIVERSITY CAFE: In this mode, we simply display the


menu option on the console with their prices. When user
selected one of the items from the menu. Console will ask the
user to input the number of items and then we displays the bill
of their items. This process continues until wants to exit the café.
After user select to exit the menu will display the bill of all the
item bought. This all process is done using loops ,arrays and
different concepts of C++.

PAGE 1
− GAMING ZONE

Implementation
FILE HANDLING

File handling is of the important concepts which allow us to do


different tasks i.e. to give input, output or append the existed file

In teacher portal, we use concept of file handling to display the names


and registration id of the enrolled student as this snippet code do the
same task. In which we save all the data in the string variable then
simply output in to console

In file handling, first we have to open the file


by using the variable file name and after it using ( .open()) In side
column it contain curly bracket they are two parameters. First
parameter is file name and second parameter is on mode in which file
is open. While loop is used to save all the data in the file. At the end
we have to close the file by using (.close())

PAGE 2
FUNCTION

A Function is the block of code who performs specific tasks. Function


allow us to make our code easy to understand and reusable. In CEA we
use different function to preforms different tasks. To use any function
we have to call it from main because our codes starts from main also
ends at main. Our code contain three main function which is

Apart from these two function we use more function to preform many
tasks. When users want to go to teacher portal he will simply
redirected to teacher portal function after that whole task is done
through teacherPortal() function. Void return type is used because It
doesn’t return anything.

Inside these bracket whole code exits for teacher portal after calling it
from main function whole code of this function executes.

After selecting one of the option the console will call one of the
function. Then whole function will execute.

PAGE 3
DYNAMIC MEMORY ALLOCATION

Dynamic memory allocation is the process of assigning the memory


space during the execution time or the run time. In this problem we
use dynamic memory allocation to make array whose number of
parameter is variable

As this is the requirement of the CEA that have to keep array size
generic so, User can calculate the grade of much student they want.
Which is only done by using dynamic array. Where ‘n’ is the number of
the students.

After using the dynamic memory we have to delete the


stack of the memory by using delete[]array name, example is given
below

PAGE 4
LOOP
A loop statement allows us to execute a statement or group of
statements multiple times. In this CEA we use loops to carry out
different function i.e. for storing the values in the array, for displaying
the data in the file and many tasks.

In the above snippet for loop is used to save values in the array.
Without using the array this task is impossible as our code is generic.

Apart from this example we have use loop to do many tasks in CEA
which are given below

PAGE 5
UNIVERSITY CAFÉ:

SWITCH CASE:

A switch statement allows a variable to be tested for equality against a


list of values. Each value is called a case, and the variable being
switched on is checked for each case.

Here above switch is used to test list of 14 items that are listed above.
From case 0 we see that when the user enter 0 the output will be
invalid since there is no item mention. Whereas when a user enters 1
the item will be displayed. Further it will tell you that how many would
you buy the selected item.

IF-ELSE STATEMENT:

If...else statement is a conditional statement in C++. The C++ if


statement runs a block statement of code if a condition is met. An if…
else statement functions the way but runs a second block of code if
condition is not met.

Here when the user enters yes(y) the condition is true which runs a
block statement allowing the user to continue to buy the items.

PAGE 6
PROGRAM OUTPUTS

TEACHER PORTAL

PAGE 7
PAGE 8
PAGE 9
PAGE 10
FILE WHICH DISPLAYS THE MARKS AND GRADES

PAGE 11
UNIVERSITY CAFÉ:

PAGE 12
GAMING ZONE

PAGE 13
LEARNING OUTCOME:

PAGE 14

You might also like