The document outlines 13 Java programming challenges ranging from creating Date and Vehicle classes to writing programs that perform calculations on user input values like finding the largest of three numbers, calculating circle areas and circumferences, reversing strings, and summing array elements and even numbers up to a given value. It provides examples of programming constructs like loops, conditionals, methods, classes, and polymorphism.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
41 views
Exercise25 07 2019
The document outlines 13 Java programming challenges ranging from creating Date and Vehicle classes to writing programs that perform calculations on user input values like finding the largest of three numbers, calculating circle areas and circumferences, reversing strings, and summing array elements and even numbers up to a given value. It provides examples of programming constructs like loops, conditionals, methods, classes, and polymorphism.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
1. Develop Date class in Java similar to the one available in java.util package.
2. Design a Vehicle class hierarchy in Java. Write a test program to demonstrate
polymorphism. 3. Write java program for find the biggest of three numbers. 4. Write java program print 1 to 100 using loops. 5. Write a Java program that performs the following steps. a. Declare two int variables named x and y. b. Assign 3 to x. c. Assign twice the value of x to y. d. Interchange the value of x and y (without explicitly assign 3 to y). e. Print the values of both variables on screen. 6. Write valid Java statements that perform the following steps. a. Declare a variable for storing a String. Name it s1. b. Have s1 refer to a new String object whose content is “Java”. c. Declare another variable named s2 and have it refer to a new String object whose content is “Programming”. d. Print the concatenation of s1 and s2 on screen. 7. Write a Java program that calculates and shows the areas and circumferences of three circles, each of which has its radius of 3, 100, and 8.75 centimeters. 8. Write a Java program that prompts for and accepts a text message from the user via keyboard and prints it out on screen. 9. Write a Java program that prompts for two text messages from the user via keyboard, connect them together, and print the result on screen. 10. Write a java program that receives a text message from keyboard and print it out if its length is between 6-10 characters. 11. Write a Java program that reverses the order of the characters in the string input from keyboard and show them on screen. 12. Write a Java program that calculates and shows the sum of all even integers from 0 to n, where n is specified by the user via keyboard. Assume that n is an integer greater than 0. 13. Write a method that receives an array of int and returns the sum of every element in the array.