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

Test - If Else - For Loop - Series - Prog - Objective

The document contains 5 programming questions of varying difficulty and point values. The questions involve calculating family trip bills based on number of days and members, finding the sum of even 3-digit natural numbers, analyzing a for loop's output and execution, calculating the sum of factorials with increasing arguments, and identifying and correcting errors in code snippets.

Uploaded by

sneh agarwalla
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)
45 views

Test - If Else - For Loop - Series - Prog - Objective

The document contains 5 programming questions of varying difficulty and point values. The questions involve calculating family trip bills based on number of days and members, finding the sum of even 3-digit natural numbers, analyzing a for loop's output and execution, calculating the sum of factorials with increasing arguments, and identifying and correcting errors in code snippets.

Uploaded by

sneh agarwalla
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

1.

Write a program to accept the number of members in a family and the


number of days the family goes out for a trip. Assume all the family
members go for the trip. Calculate the bill for the trip as follows:
Number of days Rate
More than 5 less than equal to 8 Rs. 78,000/person

For more than 8 and less than equal to 12 Rs. 1,20,000/person

Calculate and display the bill. (15 M)

2. Write a program to find sum of all 3 digit even natural numbers.


(12 M)

3. Give the output and tell how many times the loop execute (2 M)
int i;
for(i = 7; i >7; i++)
System.out.println(i);
System.out.println(i*5);

4. Write a program to find the sum of the following series (15 M)


x! + (x + 2)! + (x + 4)! + …. + (x + 10)!
10 15 20 35

5. Find the error and rewrite after correcting the error (6 M)


a) if((2x + 5 = 10 && x > 0)
b) if(b < 10)
a++;
a*=2;
or
a--;
c) for(i=10, i <20, i++)

You might also like