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 5 of 5

Thread: hello need help with my first assignments

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

    Default hello need help with my first assignments

    can anyone help me solve these assignments in java
    1
    The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets: (i) box, (ii) sideline, (iii) premium and (iv) general admission. After each game, data is input from the keybord in the following form:
    ticketPrice numberOfTicketSold
    .
    .
    .
    Sample data are shown below:
    250 5750
    100 28000
    50 35750
    25 18750
    The first line indicates that the box ticket price is $250 and that 5750 tickets were sold at that price.
    Your program must output the number of tickets sold and the total sale amount.

    2

    Write a program to perform the following steps:a) Prompt the user to enter two integers: firstNum and secondNum. (firstNum must be less than secondNum.)b) Output all the odd numbers between firstNum and secondNum inclusive.c) Output the sum of all the even numbers between firstNum and secondNum inclusive.d) Output all the numbers and their squares between 1 and 10.e) Output the sum of the squares of all the odd numbers between firstNum and secondNum inclusive.f) Output all the uppercase letters.

    if anyone have any idea how to solve these plz help thanks
    alse if anyone can give me a tip or 2 to get better at java programming in general thank u


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,105
    Thanks
    48
    Thanked 2,153 Times in 2,126 Posts

    Default Re: hello need help with my first assignments

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hello need help with my first assignments

    as i said before iam still new so i still suck at this here is my first code for the first one
    import java.util.;
    class totalticket{
     
    public static void main( string[]){
     
    Scanner console= new Scanner (system.in);
     
    int box, sideline, premium, general,sum;
     
    System.out.println("Enter box ticket price:");
     box = input.nextint();
     
     System.out.println("Enter sideline ticket price:");
     sideline = input.nextint();
     
     System.out.println("Enter premium ticket price:");
     premium = input.nextint();
     
    System.out.println("Enter general ticket price:");
     box = input.nextint();
     
     int sum = box+sideline+premium+general
     
     system.out.println("sum"+sum);
     }
     }
    yea iknow its a mess

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,105
    Thanks
    48
    Thanked 2,153 Times in 2,126 Posts

    Default Re: hello need help with my first assignments

    Can you explain what your problem is?

    Please edit your post and wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    its a mess
    Be sure that the code is properly formatted. Statements inside of {}s should be indented 3-4 spaces to make the code easier to read.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Sep 2012
    Posts
    128
    Thanks
    1
    Thanked 14 Times in 14 Posts

    Default Re: hello need help with my first assignments

    Check your calculation. You need ticket_price x number_sold. Do this for each category of ticket.

Similar Threads

  1. Replies: 5
    Last Post: March 20th, 2013, 02:29 PM
  2. I want assignments
    By .Swing in forum The Cafe
    Replies: 0
    Last Post: June 9th, 2012, 09:14 PM
  3. Help with assignments Methods Java
    By jocke01 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 8th, 2011, 08:38 PM
  4. Looking for practice problems/assignments
    By tkgraham in forum Member Introductions
    Replies: 2
    Last Post: April 4th, 2011, 10:28 PM
  5. A couple of basic java assignments, need help!
    By barnabus in forum Paid Java Projects
    Replies: 1
    Last Post: August 18th, 2010, 10:18 AM