Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a method or code snippet for each of the following problems Rewrite the following as a for loop: int i=5, value = 0; while(
- Write a method or code snippet for each of the following problems
- Rewrite the following as a for loop:
int i=5, value = 0;
while( i<=20){
if ( i % 2 == 0 && i <= 10)
value = value + i * i;
else if (i % 2 == 0 && i > 10)
value = value + i;
else
value = value - i;
}
- Assuming:
String line = ABCDEFGHIJKLMNOP;
Write code to print the contents of line backwards. You must use a loop
- During tax season, Vision Accounting, offers reduced assistance for low income individuals. Their normal hourly rate is $60.00/hour, charged at 20 minute intervals. Write a code snippet (or main program) that tells how much it would cost an individual to get help with their taxes:
- if the individual is low income ( income <= 25000), assistance is free
- if the individuals income is <= 50000,
- if the session is <= 20 minutes it is still free
- for > 20 minutes, for each 20 minutes it is 1/2 of the normal hourly rate
- for individuals making over 50000 the normal hourly rate is used, calculated at 20 minute intervals
prompt the user for the individuals income and the length of the appointment
Be sure to print out the persons income, length of the appointment and the cost
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started