Control Structures: As a build up from the previous question, consider 3 possible scenario of input : A character, number or word. You program should the do the following: In case the input is a character it should indicate if it’s a vowel or not, when a number is entered then it’s should check if it’s a prime and finally if a word is entered the system should check if it’s a palindrome or not. Sample Run1 Sample Run3 Enter a character, number or word: c Enter a character, number or word: 7 Output1: C is not a vowel Output3: 7 is a prime number Sample Run2 Enter a character, number or word: programming Output2: Programming is not a palindrome
Using the provided recording and your knowledge from programming 1. Create a program in java that takes in an input from the user and checks whether it’s a number or a word. In-case a number is entered the program should print the number to the power 3 and if a word is entered your program should split that word into 2. Sample Run1 Enter a number or word: 7 Output1: 7 to the power 3 = 343 Sample Run2 Enter a number or word: NAMIBIA Output2: The word split in half is : NAMI and BIA
Make a Mortgage Calculator code
Make a Mortgage Calculator Test code
Create a class called Team that will be used for creating team objects, the class must have the
following data members and methods:
Data Members:
Name,the name of the team
HomeGround, the name of the Home stadium of the team
Goals, the number of goals that the team scores during the match
Choose appropriate types for the data members
Methods:
A default constructor which will initialize all data members to proper initial values
An overloaded constructor which receives two arguments; a team name and home
ground name and it should also initialize the goals to a proper initial value
scoreGoals(), since a team can score 0 to 4 goals, this helper method must assign the
Goals data member to a random number in that range
getName(), getHomeGround(), getGoals(), create get methods for each data member
Make a program that will use the scanner and will output strings, int and double
ENTER FULLNAME
ENTER ADRESS
ENTER STATUS
ENTER SCHOOL NAME
ENTER FIRST NUMBER
ENTER FIFTH NUMBER
ENTER FIRST DECIMAL NUMBER
ENTER FIFTH DECIMAL NUMBER
Develop a java program to get n numbers as input and find the second duplicate and print the reverse of a number
First line contains the value n and the remaining lines contain the corresponding input
Input:
5
11
24
33
11
24
Output:
42
Note:
If the second duplicate is single digit, print as it is
If there is no second duplicate, print the first duplicate itself
If there is no duplicate, print "No duplicate found
Write a class that has three overloaded methods for calculating the areas of the following geometric shapes:
• Circle
• Rectangle
• Cylinder
Here are the formulae for calculating the area of the respective shapes:
Shape: Circle
Area Formula: A = πr2
Notes: π is Math.PI and r is the circle’s radius
Shape: Rectangle
Area Formula: Area = Width * Height
Shape: Cylinder
Area Formula: Area = 2πrh + 2πr2
Notes: π is Math.PIand r is the radius of the cylinder’s base h is the cylinder’s height
Create a "quote of the day" program. The program should read in the contents of a file containing at least 10 quotes. The program must read the quotes from the file into an array, and then randomly print one of them to the screen.
To create the text file, use Notepad or another text editor and place each quotation on a separate line. Make sure your text file is part of your project. You should also attach a seperate copy of the text file into the dropbox in case there are any issues.
Given a positive number, create an array with that number as the size and populate it with the items/names provided. Additionally, the program should print out the longest name in the array.