GitXplorerGitXplorer
g

Java-Week-2-Assignment-Promineo-Tech

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
f35fd7bffd622a624ca3651ab5a0a4c4f26ce8ba

Removed unused import in Loops.java. Must have been imported on accident.

ggryclmn committed 5 years ago
Unverified
4e6c62444ac4b1517c40563dd4af1fd61d21f254

Added README with assignment instructions.

ggryclmn committed 5 years ago
Unverified
12ceb620422308f0a5571b68585ca6edeb99f450

Initial and working commit. Assignment completed.

ggryclmn committed 5 years ago

README

The README file for this repository.

Week-2-Assignment-Promineo-Tech

Instructions: In Eclipse, or an IDE of your choice, write the code that accomplishes the objectives listed below. Ensure that the code compiles and runs as directed. Take screenshots of the code and of the running program (make sure to get screenshots of all required functionality) and paste them in this document where instructed below. Create a new repository on GitHub for this week’s assignments and push this document, with your Java project code, to the repository. Add the URL for this week’s repository to this document where instructed and submit this document to your instructor when complete.

Coding Steps:

  1. In Eclipse, create the following Boolean variables and choose what values they hold: a. isHotOutside b. isWeekday c. hasMoneyInPocket

  2. Create the following variables (not boolean type, choose the best data type for the variable): a. costOfMilk b. moneyInWallet c. thirstLevel (how thirsty you are on a scale of 1-10)

  3. Using the variables you created above and Boolean operators, create variables for the following scenarios: a. shouldByIcecream – this should be true if it is hot outside and there is money in your pocket b. willGoSwimming – this should be true if it is hot outside and it is not a weekday c. isAGoodDay – this should be true if it is hot outside, there is money in your pocket, and it is not a weekday d. willBuyMilk – this should be true if it is hot outside, and thirstLevel is greater than or equal to 3, and moneyInWallet is greater than or equal to 2 times the cost of milk.

    Example: If I had the variables isWeekday and isSummer and I was going to create a variable isSchoolDay, I would do something like the following: boolean isSchoolDay = isWeekday && !isSummer;

  4. Create a new class called Loops. In the main method of this class, create the following loops with any variables you feel are needed: a. A while loop that prints all even numbers from 0 to 100 b. A while loop that prints every 3rd number going backwards from 100 until we reach 0 c. A for loop that prints every other number from 1 to 100 d. A for loop that prints every number from 0 to 100, but if the number is divisible by 3, it prints “Hello” instead of the number, and if the number is divisible by 5, it prints “World” instead of the number, and if it is divisible by both 3 and 5, it prints “HelloWorld” instead of the number.