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

Introduction To Computing: Assignment 1 Bscs Fall 2020

This document contains 6 tasks for an assignment on computing. It provides details on calculating data type sizes in C++, interchanging variable values, calculating property taxes given assessed and actual home values, calculating loan payments, calculating calories from cookie consumption, and calculating an employee's weekly pay based on regular and overtime hours. The tasks cover basic programming concepts like input/output, calculations, and conditional logic.

Uploaded by

prince12
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

Introduction To Computing: Assignment 1 Bscs Fall 2020

This document contains 6 tasks for an assignment on computing. It provides details on calculating data type sizes in C++, interchanging variable values, calculating property taxes given assessed and actual home values, calculating loan payments, calculating calories from cookie consumption, and calculating an employee's weekly pay based on regular and overtime hours. The tasks cover basic programming concepts like input/output, calculations, and conditional logic.

Uploaded by

prince12
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

INTRODUCTION TO COMPUTING

Assignment 1

BSCS FALL 2020

Due date: 5 November 2020

Faculty of Information Technology


University of Central Punjab
TASK – 01 Marks: 05

You have been given a job as a programmer on a Cyborg supercomputer. In order to accomplish some
calculations, you need to know how many bytes the following data types use: char, int, float, and double. You
do not have any manuals, so you can’t look up this information. Write a C++ program that will determine the
amount of memory used by these types and display the information on the screen. Hint(sizeof())

TASK – 02 Marks: 05

Write a C++ program that inputs values in two integer variables and then try interchanging the values of
these two variables. i.e., first variable should hold the value of second variable and vice versa after the
transformation.

Before transformation: num1 = 5, num2 = 7


After transformation: num1 = 7, num2 = 5

TASK – 03 Marks: 10

Madison County collects property taxes on the assessed value of property, which is 60 percent of its actual
value. For example, if a house is valued at $158,000 its assessed value is $94,800. This is the amount the
homeowner pays tax on. At last year’s tax rate of $2.64 for each $100 of assessed value, the annual property
tax for this house would be $2502.72. Write a program that asks the user to input the actual value of a piece
of property and the current tax rate for each $100 of assessed value. The program should then calculate and
report how much annual property tax the homeowner will be charged for this property.
TASK – 04 Marks: 10

The monthly payment on a loan may be calculated by the following formula:

Rate is the monthly interest rate, which is the annual interest rate divided by 12. (A 12 percent annual interest
would be 1 percent monthly interest.) N is the number of payments and L is the amount of the loan. Write a
program that asks for these values and displays a report similar to the following:
Loan Amount: $ 10000.00
Monthly Interest Rate: 1%
Number of Payments: 36
Monthly Payment: $ 332.14
Amount Paid Back: $ 11957.15
Interest Paid: $ 1957.15
TASK – 05 Marks: 10

A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 “servings” in the
bag and that a serving equals 300 calories. Write a program that asks the user to input how many cookies they
actually ate and then reports how many total calories were consumed.

TASK – 06 Marks: 10

Nextbridge is a Leading software house in Punjab and also in Pakistan. Each employee is required to work
minimum 40 hours/week, excluding Saturday and Sunday, and is paid13$/Hour. And those who work extra on
Sunday/Saturday are paid 25$/hour. Now, Nextbridge has hired you to write a C++ program that calculates the
pay of an employee earned in a week. The user enters the number of extra hours, he has worked. Calculate
and display the total salary of employee per week.

You might also like