Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java School Project Help; Project #2, In Danger of Failing.....

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java School Project Help; Project #2, In Danger of Failing.....

    Hi guys, I'll cut straight to the chase; I'm in danger of failing my Java class, because I cannot any of this stuff out. It's too late for me to drop, and I can't fail the class. So, could you guys please help me out? Thanks!

    *I'm not trying to weasel my way out of doing schoolwork. I just cannot figure this stuff out, and everything I've handed in I got a 0 or a 65. Thanks.

    1. [Pass/fail] Read a grade (use type int) from the user and state whether the grade is passing or failing depending on whether or not it is 65 or higher:

    Enter your grade: 57
    Sorry, you failed!


    2. [Password] Prompt the user for a password and then either grant or deny access based on their entry (just print a message, we can't do anything else). Be sure to use an if-else statement. Remember that you need to use
    if (word.equals("swordfish"))
    rather than
    if (word == "swordfish")
    to check if the String variable word contains the string "swordfish".

    3. [Temperature converter] Ask the user if a temperature is in Fahrenheit or Celsius, then ask for the temperature. Then, based on the first answer, calculate and print the temperature in the other scale:
    Enter F or C: f
    Enter temperature: 98.6
    98.6 F = 37.0 C
    Running it again…
    Enter F or C: C
    Enter temperature: 100
    100.0 C = 212.0 F

    Use the formulas C=(5(F-32))/9 and F=1.8C+32 to do the conversion. Be sure to store the temperatures using the double data type, since the user can type a temperature with decimals.
    Finally, you can use
    if (scale.equalsIgnoreCase("C"))
    to compare the letter typed to the letter C without regard to uppercase or lowercase.

    4. [Division calculator] You're going to write a program to divide two numbers that the user enters. Prompt the user for 2 doubles. If the second number is zero, print a "divide-by-zero" error. Otherwise, calculate and print the result of dividing the first number by the second:
    Enter first number: 4.8
    Enter second number: 1.6
    4.8 / 1.6 = 3.0
    And again…
    Enter first number: 4.8
    Enter second number: 0
    Error: Division by zero

    5. 5. [Grade converter] Read an int grade from the user and convert it to A, B, C, D, F, or invalid based on the following ranges:

    Grade range Grade
    90-100 A
    80-89 B
    70-79 C
    65-69 D
    50-64 F
    Anything else invalid

    Enter grade: 82
    That grade is a B.


    Enter grade: 106
    That grade is invalid.


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Manila, Philippines
    Posts
    285
    My Mood
    Amused
    Thanks
    6
    Thanked 64 Times in 61 Posts

    Default Re: Java School Project Help; Project #2, In Danger of Failing.....

    what have you tried now? do you have errors or bugs in your code? Unfortunately, we cannot (and don't want to) give the answer or provide a code for your exams. Just give a little effort, then ask specific question and I'm sure someone here is going to assist you. it is better to create different threads with your different activities. you have plenty of days till next wednesday, you can do it.

Similar Threads

  1. Intro. to Java Help.... In Danger of Failing Class
    By john++ in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 2nd, 2014, 02:32 AM
  2. School project
    By midnight21 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 21st, 2013, 03:48 PM
  3. School Java Project Help (XML and links)
    By MC2170 in forum Java Theory & Questions
    Replies: 6
    Last Post: July 3rd, 2012, 08:44 AM
  4. School java project, completely stuck
    By John1818 in forum Java Theory & Questions
    Replies: 0
    Last Post: November 18th, 2010, 04:10 AM
  5. school project
    By robin28 in forum Java Theory & Questions
    Replies: 13
    Last Post: November 12th, 2010, 09:11 AM

Tags for this Thread