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

Second Assignment Class IX

This document contains 6 questions for a computer application assignment. Question 1 asks to find and correct errors in code segments. Question 2 asks to rewrite code segments using multiple if statements. Question 3 asks to write a program that takes a number as a parameter and determines if it is even or odd. Question 4 asks to write a program that takes temperature in Fahrenheit as a parameter and converts it to Celsius. Question 5 asks to write a program that calculates discounts and net amounts for purchases based on item type and purchase amount. Question 6 asks to write a program that calculates the amount a customer pays for a taxi based on kilometers traveled.

Uploaded by

Sushant Shukla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Second Assignment Class IX

This document contains 6 questions for a computer application assignment. Question 1 asks to find and correct errors in code segments. Question 2 asks to rewrite code segments using multiple if statements. Question 3 asks to write a program that takes a number as a parameter and determines if it is even or odd. Question 4 asks to write a program that takes temperature in Fahrenheit as a parameter and converts it to Celsius. Question 5 asks to write a program that calculates discounts and net amounts for purchases based on item type and purchase amount. Question 6 asks to write a program that calculates the amount a customer pays for a taxi based on kilometers traveled.

Uploaded by

Sushant Shukla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Second Assignment Class IX

Computer Application
___________________________________________________________________________________
Q1- Find the errors in the following program segments and write it correctly :
(a) a?(a==b) : b ;
(b) if x=!y+30
System.out.print(x);
else
System.out.print(x);
else
x++;
Q2-Rewrite each of the following program segment using more than one if construct :
(a) if(percent>80)&&percent<=90)
count+=1;
(b) if(totMarks>250 && engMarks>80 && mathMarks>95)
eligibility=Y ;
else
eligibility=N ;
(c) if(number%2==0 && number>50 && number<100)
{
c=c+1;
number=number/c;
rem=number%10;
}
Q3- Write a program to take a number form the user as parameter and find the given number is even or
odd .
Q4-Write a program to input temperature in Fahrenheit as a parameter, convert and display the given
temperature in Celsius .
Q5- A cloth showroom has announced the following festival discounts on purchase of items .
Amount of purchase
Discount in % Mill Cloth
Discount in % Handloom items
Less than Rs. 1000
2%
5%
Rs. 1000 to Rs. 5000
20%
25%
Rs. 5001 to Rs. 10000
40%
50%
Above 10000
50%
60%
Write a java program to compute the net amount paid by the customer .Assume all required values to
be inputted by the user .Make use of if Structure . total purchase amount take input as parameter.
Q6- WAP to compute the amount that a customer pays for the taxi that has hires based on the following
condition :
Kms travelled
Amount per km in Rs.
First 10 kms
25
Next 20 kms
10
Next 40 kms
15
Above 70 kms
12
Input the customers name , the taxi number and the number of kilometers travelled by him .And print
Name ,Taxi number ,kilometer ,Total amount customer has to pay.
ACME Academy-Issue on Date 24-May-2013: Date of submission 8 July-2013

Page 1

You might also like