Advertisement
belrey10

Will Sally be walking home?

Nov 2nd, 2024 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int joesApples = 3;
  2. int bobsApples = 4;
  3. String busDriverAccept = "Welcome Aboard!";
  4. String busDriverDeny = "Get Walking, bud.";
  5.  
  6. void setup() {
  7.   // put your setup code here, to run once:
  8.   Serial.begin(9600);
  9.   int sallysApples = bobsApples + joesApples;
  10.   Serial.println(sallysApples);
  11.  
  12.   double sallysMoney = sallysApples * 1.20;
  13.   Serial.println(sallysMoney);
  14.  
  15.   if(sallysMoney > 9.97) {
  16.     Serial.println(busDriverAccept); //sally affords the bus
  17.   }
  18.   else {
  19.     Serial.println(busDriverDeny); //sally can't afford the bus and walks home
  20.   }
  21. }
  22.  
  23. void loop() {
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement