COMP 378 Lecture Notes - Lecture 4: Underweight, Agame

144 views6 pages

Document Summary

} else if (bmi >= 18. 5 && bmi < 25) { } else if (bmi >= 25 && bmi < 30) { Category %s\n", ap. getweight(), ap. getbmi(), public static void main(string[] args) { Arraylist pl = new arraylist(); pl. add(new person("andrew", 125. 5, 55. 1)); pl. add(new person("boyd", 150. 0, 67)); pl. add(new person("cathy", 135, 72. 3)); pl. add(new person("donna", 190, 64)); for (person ap : pl) { System. out. printf("got valuepoint: %d \n", sum); valuepoint = sum; do { rolldice(); if (sum == valuepoint) { System. out. println("you lose!\n"); return false; lose, win); public static void main(string[] args) { Randomsumgame agame = new randomsumgame(); int lose = 0; int win = 0; System. out. println("how many rounds to play? int rnd = inp. nextint(); for (int i = 0; i < rnd; i++) { System. out. printf("you lost %d times and won %d times", if (agame. play()) else lose++; win++; inp. close(); package unit 4; import java. util. date; import java. text. simpledateformat; import java. util. calendar; import java. util. gregoriancalendar; public class station { private date arrival; private date departure; private string city;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers