0% found this document useful (0 votes)
11 views1 page

Class Test 9

The document outlines a class test with 5 questions worth a total of 14 marks. Question 1 deals with a C++ program to calculate simple interest based on principal, time, and interest rate. Question 2 deals with calculating electricity charges based on consumption. Question 3 finds a syntax error in a code snippet. Question 4 displays the reverse of a user-entered number. Question 5 generates a pattern of asterisks in rows.

Uploaded by

daksh.gupta31983
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)
11 views1 page

Class Test 9

The document outlines a class test with 5 questions worth a total of 14 marks. Question 1 deals with a C++ program to calculate simple interest based on principal, time, and interest rate. Question 2 deals with calculating electricity charges based on consumption. Question 3 finds a syntax error in a code snippet. Question 4 displays the reverse of a user-entered number. Question 5 generates a pattern of asterisks in rows.

Uploaded by

daksh.gupta31983
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/ 1

Time:40 min Class Test 9 Max Marks 14

1. Write a C++ program to input principal amount and time. If time is more than 10 years, calculate
the simple interest with rate 8%. Otherwise calculate it with rate 12% per annum. Repeat this
work till user’s choice is ‘yes’. 3
2. An electricity board charges according to following rates: 3
For the first 100 units-4 rs per unit
For the next 200 units-5 rs per unit
Beyond 300 units-6 rs per unit
All users are charged meter charge also which is Rs. 50/- Write a program to read the names
of users and number of units consumed, and print out the charges with names.
3. Find out syntax error: 2
#include<iostream.h>
void main[ ]
{ int X, Y;
cin<<X;
for(Y=0,y<10,Y++)
if( X=Y)
cout>>Y+X;
else
cout>>Y; }
4. Write a program to display reverse of a number entered by the user. 3
5. Write code to make the following pattern with n rows: 3
*
* *
* * *
* * * *

Time:40 min Class Test 9 Max Marks 14


1. Write a C++ program to input principal amount and time. If time is more than 10 years, calculate
the simple interest with rate 8%. Otherwise calculate it with rate 12% per annum. Repeat this
work till user’s choice is ‘yes’. 3
2. An electricity board charges according to following rates: 3
For the first 100 units-4 rs per unit
For the next 200 units-5 rs per unit
Beyond 300 units-6 rs per unit
All users are charged meter charge also which is Rs. 50/- Write a program to read the names
of users and number of units consumed, and print out the charges with names.
3. Find out syntax error: 2
#include<iostream.h>
void main[ ]
{ int X, Y;
cin<<X;
for(Y=0,y<10,Y++)
if( X=Y)
cout>>Y+X;
else
cout>>Y; }
4. Write a program to display reverse of a number entered by the user. 3
5. Write code to make the following pattern with n rows: 3
*
* *
* * *
* * * *

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy