0% found this document useful (0 votes)
203 views3 pages

Day 1

Day 1 of the introduction to Java covers: - Introduction to Object Oriented Programming - Introduction to Java as a programming language - Arithmetic, relational, and logical operators - if, switch, for, while, do-while, break statements - Nested loops and conditional statements - Examples include calculating taxes, retail prices, number of eggs in gross/dozen amounts, checking for palindromes and primes, generating random numbers, finding cube roots and factorials.
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)
203 views3 pages

Day 1

Day 1 of the introduction to Java covers: - Introduction to Object Oriented Programming - Introduction to Java as a programming language - Arithmetic, relational, and logical operators - if, switch, for, while, do-while, break statements - Nested loops and conditional statements - Examples include calculating taxes, retail prices, number of eggs in gross/dozen amounts, checking for palindromes and primes, generating random numbers, finding cube roots and factorials.
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/ 3

Day.

Introduction to Object Oriented Programming


Introduction to Java as a Programming Language
Arithmetic Operators
Relational and Logical Operators
The if statement, The switch statement
Nesting of if statements
The for statement
Nested for loops
The while statement
The do while statement
The break statement

Q1) Determine whether the given year is leap year or not (Read the input
through console).
Q2)
Tax slabs for general
0 to 1,80,000 No tax
1,80,001 to 5,00,000 10%
5,00,001 to 8,00,000 20%
Above 8,00,000 30%

Income tax slabs 2011-2012 for Women


0 to 1,90,000 No tax
1,90,001 to 5,00,000 10%
5,00,001 to 8,00,000 20%
Above 8,00,000 30%
Write if statements to achieve this.
Make sure that you indent the code well so that it is readable.

Q3) A shopkeeper sells three products whose retail prices are as follows:
Write an application that reads a series of pairs of numbers as follows:
Product No Product Code Retail Price
1 A 22.50
2 B 44.50
3 C 9.98
a) Product number or code (Code is not case sensitive)
b) Quantity sold
The application should use a switch statement to determine the retail
price for each product. It should calculate and display the total retail
value of all products sold.
Q4) Consider user has N eggs. Then display the no of eggs in gross (144
eggs make one gross) and no of eggs in dozen (12 eggs make one dozen)
and the no of eggs that is left out remaining. The total no of eggs can be
got as input through console. The program should display how many
gross, how many dozen, and how many left over eggs the user has.
For example, if the input is 1342 eggs, then the program should respond
with
• Your number of eggs is 9 gross, 3 dozen, and 10

Q5) Write a program to display whether the given number is palindrome


or not. Also, check whether the number is a prime number. If it is a prime
number, display the number along with the alphabet ‘p’ appended to it.

Q6) Generate a random number between 1 and 100 and display the floor
value and ceil value of the same.
e.g. floor(534.2) = 534
ceil(-23.78)= -23

Q7) Display the cube roots of the list of prime numbers till 100.

Q8) Write a program to write a Factorial of a given number using


Recursion function.

You might also like