# Et 2560 Unit 3 Exercise 1 Essay

320 Words2 Pages
ET 2560 Exercies 3.1 1. The value of x&gt;=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 &lt; 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 &lt;stdio.h&gt; int main(void) { int years; printf("Enter your number of years:\n"); scanf("years"); if (years &lt;= 0 ) printf("None\n"); else if (years &gt;= 1-5); printf("Elementary School\n"); else if (years &gt;= 6-8); printf("Middle School\n"); else if (years &gt;= 9-12); printf("High School\n"); else if (years &gt; 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, &amp;Wind); if(Wind&lt;25) printf(“Not a Strong Wind”); else if(Wind&gt;=25&amp;&amp;wind&lt;=38) printf(“Strong Wind”); else if(Wind&gt;=39&amp;&amp;wind&lt;=54) printf(“Gale”); else if(Wind&gt;=55&amp;&amp;wind&lt;=2) printf(“Whole Gale”); else if(Wind&gt;72) printf(“Hurricane”); } 7. #include main(void) { int watt; int lumens; printf(“Enter the value of watts”); scanf(“%d, &amp;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”,