Java help from school :}}

Results 1 to 7 of 7
  1. #1
    Valued Member John Ray is offline
    MemberRank
    Jan 2013 Join Date
    Zamboanga City,Location
    143Posts

    Support Java help from school :}}

    anyone has a background on java? using JCreator?
    :

    Exercise 1 — Area Circ

    Calculate the area and circumference of a circle using the formula pi [a constant of 3.14, use Const PI = 3.14] times radius squared. The radius is a Double entered by the user. Make it so the user can enter different radii and find the result. Format your answers to two decimal place.
    Exercise 2 — Meter Yards

    Write a program to convert Square Meters to Square Yards or Square Yards to Meters. The conversion factor is 1 meter = 1.1 yards. This is Meters to Yards. You will need to derive your conversion factor for Square Meters to Square Yards. Format your answer to 3 decimal places.
    Exercise 3 — Bananas

    Find the total cost of a purchase of bananas. Ask the user for the cost price of 1 kilo of bananas. Ask the user how many kilos they would like to buy. Your output should be the final bill formatted to 2 decimal places.[ex.: 4 kilos of bananas at $1.55 per kilo = $6.20]
    Exercise 4 — Years Seconds

    Write a program that works out the number of seconds in a year. Use that number to figure out how many seconds there are in any number of years input by the user. Assume a year is 365 days.
    Exercise 5 — Inches Centimeters

    Write a program which asks the user to input inches and centimeters. then convert inches to centimeters and centimeters to inches. Use 2.54 as the conversion rate. The conversion rate should be declared as a constant. The inches and the centimeters should be declared as a double.
    Exercise 6 — School Label

    Write a program that asks the user for 5 inputs: his first name, last name, school, city, and province. It should output this approximately centered on the computer screen in 3 line. The first line should be the first and last name, the second line should be the school, the third line should be the city and province.
    Exercise 7 — Address Label

    Write a program that asks the user for 5 inputs: his first name, last name, street address, city, and province. It should output this approximately centered on the computer screen in 3 line. The first line should be the first and last name, the second line should be the street address, the third line should be the city and province. They should be aligned left and look like an address label.
    Exercise 8 — Hours Minutes

    Write a program in which the user enters a number of minutes. The result should be in hours/minutes format. The output should look like this:
    Enter the number of minutes: 411
    That is 6 hours and 51 minutes
    Exercise 9 — My Height

    Write a program that asks for your height in inches, then converts this to both feet and inches and centimeters and gives both of these as outputs.
    Exercise 10— Four Digit

    Write a program that accepts a 4 digit integer. The program should output the four numbers in separate lines.


    Enter a 4 digit number: 2543
    The first number is: 2
    The second number is: 5
    The third number is: 4
    The fourth number is: 3
    Exercise 11 — Pizza

    The labour to make any pizza costs $1.35. In addition the cost of a pizza is determined by it's diameter according to the formula:


    Cost = $0.08*diameter*diameter

    Write a program to work out the cost of making a pizza, in which the user inputs the size of the pizza in inches, with the output being formatted to $xx.xx, dollars and cents.
    Exercise 12 — Basketball

    Write a program that asks for the number of people in a gym class. The program should then divide that number into 5 player basketball teams. The output should report how many teams there are and how many players are left over. The output should look like this:

    Enter the number of students: 32
    There will be 6 teams and 2 students left over
    Exercise 13 — Int Mod

    Write a program that has the user enter two integers. The program should then display the results of the integer (\) and modulus (Mod) divisions in either order. The output should look like:
    Enter the first integer: 26
    Enter the second integer: 5
    26 \ 5 = 5
    5 \ 26 = 0
    26 Mod 5 = 1
    5 Mod 26 = 5
    Exercise 14 — Alive

    Ask for inputs of a users birthday [the day, the month, and the year]. Ask for the current day, month and year. All inputs should be in numeric form. Make sure you label your requests clearly, so you obtain the required inputs. Assuming that each month has 30 days, calculate the number of days the user has been alive.
    Exercise 15 — Body Mass Index

    Write a program that asks for your height in feet and inches, and your weight in pounds. The program should first convert your height to inches only. Then it should convert this to meters by multiplying by 0.0254. Your weight should be converted to kilograms by dividing by 2.2 You can then find your BMI [Body Mass Index] by dividing your mass in kilograms by your height in meters squared. BMI = kg/m^2. All your conversion factors should be declared as constants.


  2. #2
    Enthusiast papichulo is offline
    MemberRank
    Feb 2012 Join Date
    43Posts

    Re: Java help from school :}}

    this is so simple i provide SS of how i code the Exercise # 12 , but im not using JCreator , i used Textpad 7 with jdk 7

    java.png this is where you ask user to input numbers of student

    java2.png this would be the result in a Messagedialog

    java3.png this would ask user to try again with YES_NO_OPTION,
    Last edited by papichulo; 14-07-13 at 12:08 AM.

  3. #3
    Valued Member John Ray is offline
    MemberRank
    Jan 2013 Join Date
    Zamboanga City,Location
    143Posts

    Re: Java help from school :}}

    can you help on the way bro?

    coz my tacher is a terror and he is so mad about i dont know why? then suddenly he gave us this problems and to be pass as soon as possible.

  4. #4
    Enthusiast papichulo is offline
    MemberRank
    Feb 2012 Join Date
    43Posts

    Re: Java help from school :}}

    i can help you about this bro but first tell me what class should be used? it is BufferedReader or JOption and if it should be an OOP or the simplest one... and also give me your email afterward ill send it to you tomorrow.

  5. #5
    Valued Member John Ray is offline
    MemberRank
    Jan 2013 Join Date
    Zamboanga City,Location
    143Posts

    Re: Java help from school :}}

    Quote Originally Posted by papichulo View Post
    i can help you about this bro but first tell me what class should be used? it is BufferedReader or JOption and if it should be an OOP or the simplest one... and also give me your email afterward ill send it to you tomorrow.
    the simple one bro, for me to be able to understand.

    :)

    thanks by the way bro.
    #this is my e-mail (sadang.john@yahoo.com)

  6. #6
    Valued Member John Ray is offline
    MemberRank
    Jan 2013 Join Date
    Zamboanga City,Location
    143Posts

    Re: Java help from school :}}

    bro you still there? :)

  7. #7
    Valued Member John Ray is offline
    MemberRank
    Jan 2013 Join Date
    Zamboanga City,Location
    143Posts

    Re: Java help from school :}}

    Quote Originally Posted by papichulo View Post
    i can help you about this bro but first tell me what class should be used? it is BufferedReader or JOption and if it should be an OOP or the simplest one... and also give me your email afterward ill send it to you tomorrow.

    bro? need it badly :) where are you?



Advertisement