Java Reference
In-Depth Information
Name of exercise 3:
Presentation
Score received for exercise 3:
5
Total points possible for exercise 3:
8
Exercise Score Total Possible
Group Project 10 10
Homework 7 12
Presentation 5 8
Total 22 30
Your total is 22 out of 30, or 73.33%.
12. (This is a variant of an exercise from Chapter 1.) Create a text file that contains the
text "I hate programming!" Write a program that reads in this line of text from
the file and then the text with the first occurrence of "hate" changed to "love" . In
this case, the program would output "I love programming!" Your program should
work with any line of text that contains the word "hate" , not just the example given
in this problem. If the word "hate" occurs more than once in the line, your program
should replace only the first occurrence of "hate" .
13. (This is an extension of an exercise from Chapter 1.) A simple rule to estimate your
ideal body weight is to allow 110 pounds for the first 5 feet of height and 5 pounds
for each additional inch. Create the following text in a text file. It contains the names
and heights in feet and inches of Tom Atto (6'3”), Eaton Wright (5'5”), and Cary Oki
(5'11”):
VideoNote
Solution to
Programming
Project 2.12
Tom Atto
6
3
Eaton Wright
5
5
Cary Oki
5
11
Write a program that reads the data in the file and outputs the full name and ideal
body weight for each person. In the next chapter, you will learn about loops, which
allow for a more efficient way to solve this problem.
Search WWH ::




Custom Search