Question: Projects P - 1 . 2 6 Write a short Java program that takes all the lines input to standard input and writes them to

Projects
P-1.26 Write a short Java program that takes all the lines input to standard input and
writes them to standard output in reverse order. That is, each line is output in the
correct order, but the ordering of the lines is reversed.
P-1.27 Write a Java program that can simulate a simple calculator, using the Java console
as the exclusive input and output device. That is, each input to the calculator, be
it a number, like 12.34 or 1034, or an operator, like + or =, can be done on a
separate line. After each such input, you should output to the Java console what
would be displayed on your calculator.
P-1.28 A common punishment for school children is to write out a sentence multiple
times. Write a Java stand-alone program that will write out the following sen-
tence one hundred times: "I will never spam my friends again." Your program
should number each of the sentences and it should make eight different random-
looking typos.
P-1.29 The birthday paradox says that the probability that two people in a room will
have the same birthday is more than half, provided n, the number of people in the
room, is more than 23. This property is not really a paradox, but many people
find it surprising. Design a Java program that can test this paradox by a series
of experiments on randomly generated birthdays, which test this paradox for n=
5,10,15,20,dots,100.
P-1.30(For those who know Java graphical user interface methods:) Define a Graphi-
calTest class that tests the functionality of the CreditCard class from Code Frag-
ment 1.5 using text fields and buttons.
 Projects P-1.26 Write a short Java program that takes all the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!