You are on page 1of 6

1.Grocery Shopping List and Bill Calculator.

The program should accomplish the following


tasks:

 Display a menu of grocery items with their respective prices.


 Ask the user to choose items they want to buy from the menu. For each
selected item, prompt the user to enter the quantity they wish to purchase.
Ensure that the quantity entered is greater than 0.
 Then display the final bill amount.

Code

Output

2. Write a C++ program to input basic salary of an employee and calculate its Gross salary
according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%

Code

Output

3.Program to print natural numbers in reverse from n to 1 using while loop.


Note: check whether the number is positive or not.

Code
Output

4. Program to Generate Fibonacci Sequence up to a Certain Number. The Fibonacci


sequence is a series of numbers where a number is found by adding up the two
numbers before it. Starting with 0 and 1, the sequence goes 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and
so forth.
Code

Output

5.Write a method with a while loop that computes the sum of first n positive integers: sum =
1 + 2 + 3 + … + n.

Code

Output
6.Write a C++ program to calculate the approximate values of sin(x) and cos(x) using the Taylor series
expansion. You should allow the user to input the value of 'x' and the number of terms in the series to
use. The program should then display the calculated values of sin(x) and cos(x).
Code

Output

You might also like