This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
Drop by and say hi! (Recycle Bin)
Post Reply
Return to board index
Post by
273605
This post was from a user who has deleted their account.
Post by
Adamsm
you shrugger!
It feels good. *creepy laugh*
Post by
Toldry
Java homework time!
Lets see which cheesy homework they gave me.
The first question roughly translate to this:
The movie theater "The Big Movie" are showing two movies at the same time. Each person can buy tickets for
one
of the movies. You must make a program that gets for each person which movie (1 or 2) he selected and how many tickets he wants to buy. The program must calculate and print:
The number of tickets sold for each of the movies.
The average amount of tickets sold to the second movie. (Keep in mind that maybe no tickets were sold for this movie)
The number of people who bought between 3 and 5 tickets for any of the movies.
The program will end once the data for both of the inputs will be zeroes.
And here is my answer:
import java.util.Scanner;
public class Temporary
{
public static void main(String
I know none of you care about all of this but I want to post it anyway!
Post by
Arkaen
Fuzzy Wuzzy is your father
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
They didn't ask for the number of people who bought tickets or anything.
That's why I had to make the movie2_counter so I could calculate the average amount of tickets bought.
Post by
273605
This post was from a user who has deleted their account.
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
These numbers will always be 1 or 0, depending on the input. I assume they'd want something different.
Wha?
Also!
if(tickets>=3||tickets<=5)
buyer_counter++;
Don't you mean (tickets>=3 &
&
tickets<=5)
Yush, Danke.
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
Next question:
A toy store decided to monitor the sales of the toys.
You must make a program that takes the amount of toys sold at that day. (Wtf do they mean "at that day"?)
For each toy that is sold you must take:
The toy's code.
The price of the toy.
If it is in a discount or not (S - Discount, N - Regular)
The program must calculate and print:
What is the code of the most expensive toy that was sold.
What is the number of toys that their price is above ₪50.
What is the average price of a toy.
(When does the program end? >_>)
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
What's:
prompt
empty string
the vent information
the link to a site that I can download a ventrilo client that works on Windows 7 from
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
Here's me two minutes ago
Post by
Interest
Here's me two minutes ago
Whoa...What kind of addon do you use to make the words have that font?
Post by
273605
This post was from a user who has deleted their account.
Post by
Toldry
What's:
prompt
I'll explain once you get on vent
empty string
see above
the vent information
platinum.typefrag.com port 8939
the link to a site that I can download a ventrilo client that works on Windows 7 from
ventrilo.com
download the vista version. More specifically:
http://ventrilo.com/dlprod.php?id=1
for 32bit,
http://ventrilo.com/dlprod.php?id=4
for 64bit
Those don't work.
Post by
Toldry
Here's me two minutes ago
Whoa...What kind of addon do you use to make the words have that font?
Not a addon.
Post by
273605
This post was from a user who has deleted their account.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.