Write a program to allow the user to enter their weight

Assignment Help JAVA Programming
Reference no: EM132409036

Topic: Control Structures

1. Create a class called EvenNos

Write a program that will add the first 100 even numbers.

2. Create a class called LargestDecimal

Write a program that prompts the user to enter three different decimal numbers and prints out the largest of them.

3. Create a class called CharPrint

Write a program that reads in a word and prints out each character of the word on a separate line. Hint: use a “for” loop and the charAt method.

4. Create a class called ReverseWord

Write a program that reads in a word and prints it out in reverse.

5. Create a class called Tuition

Tuition fees for a university is £9,000 this year and it increases by 6% every year. Write a program to allow the user to enter their current age and get the program to work out the user’s age when the tuition fees is three times the initial fee of £9000.

Challenge

Work on the Balance and BMI classes from previous exercise.

6. Amend the Balance class to work out the balances after the first, second, third etc. up to and including the tenth year. Once again, your program should prompt the user to input a starting balance and interest rate (intRate). Balance for a year is calculated as (1 + intRate) multiplied by balance for the previous year.

Example: For 5% interest rate, the user should enter 0.05

7. Amend the class called BMI

Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters.

Write a program to allow the user to enter their weight in pounds and height in inches. Note that if one pound is 0.4535 kilograms and one inch is 0.0254 meters, display the BMI for the user.

Add additional lines of code to display a message to say “you are over-weight” if the BMI exceeds 25 or display a message to say “you are under-weight” if the BMI is 20 or less otherwise, display a message to say “you are fine”

Make further enhancements to ask the end user how times they want to run this program and then alter your code to accommodate this request.

8. Create a class called UserDetails so that the following is repeated 3 times for 3 separate users.

Ask user to enter their firstname

Ask user to enter their lastname

Write code to work out the user’s username by taking the first 3 letters of their firstname and first 2 letters of their lastname. The username should be in uppercase.

In addition, you need to ask the user their age and if they have a driving licence. Display fullname using title case, username and age if and only if the user has a driving licence.

9. Create a class called Stars. Use nested for loops to generate the following output:

1268_Pattern.jpg

10. Create a class called GuessNum.

Write code that randomly generates an integer between 1 and 100, inclusive. The program prompts the user to enter a number continuously until the number matches the randomly generated number. For each user input, the program tells the user whether the input is too low or too high, so the user can choose the next input intelligently. Display the number of attempts made for the user to guess the number.

Reference no: EM132409036

Questions Cloud

Develop a menu driven program that will allow the end user : Develop a menu driven program that will allow the end user to select options for invoking methods from the UserInformation and BMI classes created previously.
Write a method that will add the first n even numbers : Write a method to work out the sum of the first n odd numbers. Write a method that prompts the user to print out the smallest of three given numbers.
Design and implement a class named modules : Design and implement a class named Modules that may contain several Module objects. Write a short application to test your Modules class.
Finding the probability that the sample mean cost : Finding the probability that the sample mean cost of these 36 schools is between $24000 and $26000: P(24000
Write a program to allow the user to enter their weight : Write a program that reads in a word and prints out each character of the word on a separate line. Hint: use a “for” loop and the charAt method.
Internship program for college students to participate : Northwestern Mutual Life Insurance has an internship program for college students to participate in training and become field agents in one academic term.
What is the sample standard deviation : A history professor took a sample of 10 final exam scores from a class of 30 students. The 10 scores are shown in the table below:
State the null and alternative hypotheses in words : What is the variable in this test? What type of variable is it (nominal, ordinal, or continuous)? State the null and alternative hypotheses in words
Interpret the meaning of the mean and standard deviation : Three students volunteer for a taste test comparing Coke and Pepsi. Each student tastes samples in two identical-looking cups and decides which beverage

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd