Et 2560 Unit 3 Exercise 1 Essay

320 Words2 Pages
ET 2560 Exercies 3.1 1. The value of x>=y-x is 1. Because the expression is true, the value has to be 1. 2. Value of the expression is 2, because both expressions are 1 and 1+ 1 = 2. 3. if (deduct < balance) { balance = balance – deduct; printf(“New balance is %.2f”, balance); } else { printf(“Deduction of %.2f refused.”, deduct); printf(“would overdraw account.”); } printf(“Deduction=%.2f Final balance=%.2f’, deduct, balance) 4. ice_forming 5. #include <stdio.h> int main(void) { int years; printf("Enter your number of years:\n"); scanf("years"); if (years <= 0 ) printf("None\n"); else if (years >= 1-5); printf("Elementary School\n"); else if (years >= 6-8); printf("Middle School\n"); else if (years >= 9-12); printf("High School\n"); else if (years > 12); printf("College\n"); else printf("Bad Data Entered\n"); return 0; } 6. #include main(void) { int Wind; printf(“Enter Value of Wind: “); scanf(“%d, &Wind); if(Wind<25) printf(“Not a Strong Wind”); else if(Wind>=25&&wind<=38) printf(“Strong Wind”); else if(Wind>=39&&wind<=54) printf(“Gale”); else if(Wind>=55&&wind<=2) printf(“Whole Gale”); else if(Wind>72) printf(“Hurricane”); } 7. #include main(void) { int watt; int lumens; printf(“Enter the value of watts”); scanf(“%d, &watt); switch(watt) { case 15: lumens=125; printf(“Brightness: %d”, lumens); break; case 25: lumens=215; printf(“Brightness: %d”, lumens); break; case 40: lumens=500; printf(“Brightness: %d”, lumens); break; case 60: lumens=880 printf(“Brightness: %d”, lumens); break; case 75: lumens=1000; printf(“Brightness: %d”, lumens); break; case 100: lumens=1675; printf(“Brightness: %d”,

    More about Et 2560 Unit 3 Exercise 1 Essay

      Open Document