Faisal bank need a ATM machine. In this machine they need to add all possible currency divisions (1, 2, 5,
10, 20, 50, 100, 500, 1000, 5000). Write a C++ program in which, take required amount from user and find
the required currency division which will give to user in order to pay the required amount.
Example:
Sample input:
Enter required amount: 7895
Required currency division is:
5000: 1
1000: 2
500: 1
100: 3
50: 1
20: 2
10: 0
5: 1
2: 0
1: 0
A carpenter wants to make a bed set; he wants to calculate the required wood for it. 10.5 sq foot wood
required for side tables. 15 sq foot required for dressing table and 35.75 sq foot wood required for bed.
Cost of each sq foot is 5000. Write a C++ program in which, take number of bed set required and calculate
the total required wood and total cost of wood.
Example:
Sample input:
Enter required number of bed set: 3
Sample output:
Total bill is: 918750
In the month of RAMZAN people distribute food packages. Carrefour offers a food package which contains
the following items 10kg flour, 5kg rice, 5ltr oil, 2pack salt and 500gm spices. Price of above items are:
1. Flour per kg 95
2. Rice per kg 210
3. Oil per liter 410
4. Salt per pack 50
5. Spices per 10 grams 5
Write a C++ program in which, take number of required bag from user and calculate the total price of
required packages and display it on console.
Faisal bank need a ATM machine. In this machine they need to add all possible currency divisions (1, 2, 5,
10, 20, 50, 100, 500, 1000, 5000). Write a C++ program in which, take required amount from user and find
the required currency division which will give to user in order to pay the required amount.
Write a program to try-catch blocks can be nested. Also ,an exception can be re-thrown using thrown
1. Time measurement using song duration
Consider that Alice is cycling from point A to point B. During the cycling, Alice is listening to songs in her music player.
Given the following inputs:
1. The distance between A and B in metres
2. The speed at which Alice is traveling in metres per second
3. Duration of each song in her playlist in the
following format: mm:ss
the program should:
• Print the number of the song that Alice is listening when the cycling is completed from A to B
· Print Invalid input if any of the constraints mentioned in the constraints section is violated
Example 1
Consider the following inputs:
2000
5
Now consider the following list of songs:
05:30
02:04
Explain the role and purpose of the two codes provided below.
Create or Replace Trigger Purchase_Entry
After Insert or Update of Purchase_Amt on PURCHASE_AGREEMENT
For Each Row
Begin
if(:New.Purchase_Amt < 0) Then
RAISE_APPLICATION_ERROR(‐20100,
'Cannot enter a purchase agreement amount less than zero.');
end if;
End;
insert into PURCHASE_AGREEMENT values (559, '27 May 2020', ‐1, 12350,'C122',1)
What will be the output of the following code segment?
void fun()
{
static int i=10;
print ("%d", ++i);
}
int main ()
{
fun ();
fun();
func (int i)
{
if (i%2) return 0;
else return 1;
}
int main ()
{
int i =3;
i= func (i);
i= func (i);
printf ("%d";i);