Question
Write a program that reads three integer numbers from the user and prints the numbers in ascending order. 2. Write a Java program to check
Write a program that reads three integer numbers from the user and prints the numbers in ascending order.
2. Write a Java program to check whether a number is divisible by 5 and 11 or not.
3. Write a Java program to calculate profit or loss in percentage. Take as input the purchase price and sale price from the user.
4. Write an application that asks the user to enter his income for six months. The program then calculates and displays the total, average, maximum and minimum income.
5. Write a program that asks the user to enter a sequence of odd numbers. The program should stop as soon as the user enters an even number.
Your program should display how many odd numbers the user entered before entering an even number.
6. Write a program that finds and prints the first 10 prime numbers. Please note that a prime number is one that is divisible only by 1 and by itself. The first four prime numbers are 1, 2, 3, and 5.
7. Write a program that asks a student to enter his score (between 0 and 100) in CS120 and print the student's letter grade according to the following table.
90 to 100 A
80 to 89 B
70 to 79 C
60 to 69 D
0 to 59 F
8. Two car companies give a discount on their car prices as described in table 2. Write a program that asks a user to enter the brand of the car and the total price. Your program should display the net price after the discount. Table 2: Car Price Discount Table
9. Write a program that finds the value of y using the formula given below for values of x in the sequence 1, 3, 5, 7, ..., 19.
y = 3 x
2 + 5x + 7
10. Write a program that generates 1000 random numbers between 0 and 100. Your program should calculate and print how many numbers were
between 30 and 40 (including both). You can use Random class to generate random numbers.
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Sure I can provide you with Java programs for each of the tasks you mentioned Here they are Java program to read and print three integer numbers in as...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started