CS.11.01-Lab1.1

Fork this repository. Clone the forked repository into IntelliJ. There are two Java class files: Dateable and Pages. Complete the first question in the Dateable class. Complete the second question in the Pages class.

Once completed, update your repository (commit and push your code changes to your repository), inspect your repository to see that the changes that you made were successfully pushed, and paste to a text file on Schoology the URL to the topmost level of your repository.

On the same page that you pasted your link to in Schoology, state one strength and how you used it in the completion of this lab.

Format your submission exactly as below:

Repository: [insert URL of repository here]

Strength: [state strength used and give a brief description of how you used this strength in the completion of this lab]

  1. Dateable

There is a folk rule stating you should only date someone who is at least seven years older than half your age. For example, an 18-year-old needs to date somebody at least 16 years old ( 7 + ( 18 / 2 ) ).

Produce a program that stores your age as an integer in a variable named age. The program then computes and displays the age of the youngest person for whom dating meets the folk rule.

A sample program run could be :

Prompt + input: Enter your age: 19

Output: 19-year olds should date somebody who is at least 16 years old.

Another sample program run could be:

Prompt + input: Enter your age: 22

Output: 22-year olds should date somebody who is at least 18 years old.

Credit: Thanks to Jim Cohoon at The University of Virginia

  1. Pages

There is a folk rule stating the number of pages you should read before giving up on a book is 100 - your age. For example, a 21 year old needs to read 79 pages ( 100 - 21 ). Write a program that stores your age as an integer in a variable named age. The program then computes and displays the minimal number of pages to read.

A sample run could be:

Prompt + input: Enter your age: 18

Output: 18-year olds should read at least 82 pages before giving up on a book.

Another sample program run could be:

Prompt + input : Enter your age: 30

Output: 30-year olds should read at least 70 pages before giving up on a book.

Credit: Thanks to Jim Cohoon at The University of Virginia