0% found this document useful (0 votes)
12 views3 pages

Assignment # 1

This document outlines Assignment #1 due on October 11, 2020, focusing on console output, variables, and control structures in C++. It includes five programming questions requiring students to implement specific functionalities such as displaying personal information, calculating sales totals, converting hexadecimal to binary, calculating age, and converting numbers to English words. Students must adhere to naming conventions, avoid plagiarism, and ensure proper coding practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Assignment # 1

This document outlines Assignment #1 due on October 11, 2020, focusing on console output, variables, and control structures in C++. It includes five programming questions requiring students to implement specific functionalities such as displaying personal information, calculating sales totals, converting hexadecimal to binary, calculating age, and converting numbers to English words. Students must adhere to naming conventions, avoid plagiarism, and ensure proper coding practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment # 1

Due Date: Sunday 11 Oct, 2020, 11:59 PM


On Google Classroom
Objective: Console Output, Variables and Control Structure
NOTES:
1. Understanding the question is part of assignment, so do not ask anyone else to understand the
problem for yourself and tell you the solution. Do it yourself.
2. The name of cpp files should be l20XXXX_q_no.cpp where XXXX is your roll number.
3. Make a .zip file which will contain all cpp files and name that zip file as l20XXXX.zip and submit
this zip file.
4. Always check the boundary values [Recall Problem solving].
5. Always use proper variable names and proper indentation for readability.
6. Always use comments to elaborate the code.
you can comment in c++ through:
// This is single line comment
/* This is
Multi line
Comment */
7. Always follow the output and input format.
8. DON’T involve in PLAGIARISM.
Question # 1 [Your & Course Info. ] :
Write a c++ program to output the given screen after inserting your roll number and name. [Use escape
sequence].
Sample Input/Output:

**********************************
* Roll Number: 20L-XXXX *
* Your Name *
* Assignment # 1 *
* Course: Programming F. *
* Due Date: 11 Oct, 2020 *
**********************************

Question # 2 [Sales Total]:

A customer in a store is purchasing five items. The prices of the five items are:
Price of item 1 = Rs 12.95
Price of item 2 = Rs 24.95
Price of item 3 = Rs 6.95
Price of item 4 = Rs 14.95
Price of item 5 = Rs 3.95
Write a program that holds the prices of the five items in five variables. Display
• each items price,
• the subtotal of the sale,
• the amount of sales tax, assume the sales tax is 6%.
• and the total: Total Sale = Sub Total of Sale + Sales Tax
Note: Carefully choose the data types to hold data. Which should be int (if any) and which should
be float (if any)?
Sample Input/Output:

Output:
Price of item 1 = Rs 12.95
Price of item 2 = Rs 24.95
Price of item 3 = Rs 6.95
Price of item 4 = Rs 14.95
Price of item 5 = Rs 3.95

The subtotal of the sale : 63.75


The sales tax is: 3.825
Total sale: 67.575

Question # 3 [Hexadecimal to Binary & Octal]:


Consult the link: https://www.rapidtables.com/convert/number/hex-to-binary.html
Write a c++ program to take a hexadecimal number from 00 to FF. Convert it to binary (direct method)
and show on console.
Sample Input/Output:

Input:
HEX digit # 1: F
HEX digit # 2: E
Output:
Binary equivalent to FF is: 11111110

Question # 4 [Calculate Your Age]:


Consult the link: https://www.calculator.net/age-calculator.html
Write a c++ program to take input your date of birth & the current date and prints the exact age.

Sample Input/Output:

Input:
Input Date of Birth:
Day : 14
Month : 2
Year : 2000
Input the Current Date:
Day : 3
Month : 10
Year : 2020
Output:
You are 20 years 7 months 19 days
Question # 5 [Number in English Words]:
Consult the link: https://www.calculatorsoup.com/calculators/conversions/numberstowords.php
Write a c++ program which takes input a number from 1 to 999 and print the equivalent number in
words of English.
Sample Input/Output:

Input:
Number : 847
Output:
Eight Hundred Forty Seven

********************** Best of Luck **********************

You might also like