0% found this document useful (0 votes)
31 views2 pages

Lab 5

This document provides instructions for two lab tasks on fundamentals of computer programming in C. The first task asks students to take a 5 digit integer as input, separate the digits, and store each in a separate variable. The second task asks students to design a marksheet generation program that takes subject marks as input, calculates percentage and grade, and outputs a formatted marksheet. Students are to develop pseudocode and implement the program in C, ensuring valid input and a printed output format. Help from lecture slides and TAs is available, and students must submit source code and pseudocode on the LMS to complete the lab.
Copyright
© Attribution Non-Commercial (BY-NC)
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)
31 views2 pages

Lab 5

This document provides instructions for two lab tasks on fundamentals of computer programming in C. The first task asks students to take a 5 digit integer as input, separate the digits, and store each in a separate variable. The second task asks students to design a marksheet generation program that takes subject marks as input, calculates percentage and grade, and outputs a formatted marksheet. Students are to develop pseudocode and implement the program in C, ensuring valid input and a printed output format. Help from lecture slides and TAs is available, and students must submit source code and pseudocode on the LMS to complete the lab.
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 2

Institute of Geographical Information Systems (IGIS-SCEE)

National University of Sciences & Technology (NUST)

Fundamentals of Computer Programming


CS-110 Date: March 5, 2012 Lab5
You have already learnt how to use control statements and repetition statements. You have also learnt how to use nested control statements and different operators. In this lab we'll be learning how to apply these concepts in C. Lab Task 1: Problem Statement:
Take a 5 digit number as input from a user e.g . 11245 and store it in an integer variable. Your task is to separate the digits in this integer and store every digit in a separate variable. For example if int i = 11245 then take 5 integer variables and store each digit 1,1,2,4,5 separately and print them on the screen. (Hint: You may require the use of division (/) operator or the modulus (remainder) % operator to perform this task.

Lab Task 2: Problem Statement: In this task you must develop apply the stepwise top down refinement approach to solve the given problem. The task at hand is to design a complete marksheet generation software. The software takes input marks of any number of subjects (hint: use sentinel control value), calculates the percentage and gives a grade based on the total number of subjects entered. 1. Develop the pseudo code 2. Implement the C program You must ensure that The user must not input a value of greater than 100 while entering marks The user should be able to enter marks for as many subjects as he may like The output of the program should be in a proper format that resembles a printed mark sheet that you may have received when you passed in college or school.

Institute of Geographical Information Systems (IGIS-SCEE)


National University of Sciences & Technology (NUST)

NOTES: For help use your lecture slides or You can ask for help from the TAs You have to submit your source code files and Microsoft word file (which contains your pseudocode) on LMS to complete the lab

You might also like