0% found this document useful (0 votes)
173 views

Week005 Lab4 HandlingPrimitiveDataTypes Edited

This document provides instructions for a laboratory exercise on data input and output in C++. The exercise contains a series of programming problems requiring students to write code that accepts user input using cin and displays output using cout. Students are expected to create projects in Visual Studio Code to write solutions for each problem, handling data with variables. The problems include displaying a formatted section input, calculating the square of a daily budget, and outputting name, password, and address with a greeting using only three variables while supporting spaces.
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)
173 views

Week005 Lab4 HandlingPrimitiveDataTypes Edited

This document provides instructions for a laboratory exercise on data input and output in C++. The exercise contains a series of programming problems requiring students to write code that accepts user input using cin and displays output using cout. Students are expected to create projects in Visual Studio Code to write solutions for each problem, handling data with variables. The problems include displaying a formatted section input, calculating the square of a daily budget, and outputting name, password, and address with a greeting using only three variables while supporting spaces.
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/ 2

Course Code CS201

Description Computer Programming 1

Laboratory
Title of
Exercise 004 Data, I need Data!
Activity
No.
Page 1 of 2
LABORATORY EXERCISE

In this activity, you will be given a series of problems that will challenge your logical understanding of
C++ covered by the modules, and not. For each problem, you are expected to create a project and write a
working solution depending on the requirements of the problem.

Always keep in mind, think outside the box.

Objective/s:
At the end of this activity, the students are expected to be able to:
 discuss the implications of the given problems
 use the cin>> and cout<< statements correspondingly
 declare variables that will hold the data entered by the user

Material/s Needed:
 Visual Studio Code
 MinGW

Procedure:
1. Make sure you have a running version of the “Hello World” application shown in Module 004. If
not, review the steps to setup your Work Environment.
2. There will be a series of problems you are required to code. For each, you need to provide C++
codes for the actual solution.
3. Keep the project files for record as they may be requested by the instructor.

Questions:
1. Write a program that accepts user’s section, and display them back with the format “*** Section:
user’s section ***”.
2. Write a program that accepts user’s daily budget and display the product of the daily budget and
itself.
3. Write a program that accepts user’s name, password and address and display them back using the
format “Hi, I am user’s name. I live at user’s address.”.
Restrictions:
 Use only three variables.
 Make sure you support spaces.
4. What can you conclude from this activity?

1
Course Code CS201

Description Computer Programming 1

Laboratory
Title of
Exercise 004 Data, I need Data!
Activity
No.
Page 2 of 2
LABORATORY EXERCISE

INSTRUCTIONS FOR THE STUDENTS:


 The filename of your lab activity should be:
“<Last Name><First Name>-LaboratoryExercise0<XX>”
 Provide screenshots of your VS codes and program output copied to a Word file.
 Upload the Word file to the link provided for the activity in the LMS.

You might also like