Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help with c program that will have a system pause at the end. 1. Program to comp

ID: 3699868 • Letter: H

Question

Help with c program that will have a system pause at the end.
1. Program to compute the car insurance premium for a person based on their age and the number of tickets they have received. The following table explains how to perform the ticket computation: If Person's Age Is: Then Insurance Cost Is- Less than 21
$1500 + $250 x number of tickets
From 21 through 24
$1200 + $250 x number of tickets
25 or older
$1000 + $200 x number of tickets
Print the person’s age, number of tickets and the computed insurance cost.
2. Write a program to compute the Mileage given by a vehicle.
Mileage = (new_odometer – old_odometer)/(gallons_gas)
Program illustrating how ‘for’ loop works.
3. Program to find the factorial of a number using recursive function Help with c program that will have a system pause at the end.
1. Program to compute the car insurance premium for a person based on their age and the number of tickets they have received. The following table explains how to perform the ticket computation: If Person's Age Is: Then Insurance Cost Is- Less than 21
$1500 + $250 x number of tickets
From 21 through 24
$1200 + $250 x number of tickets
25 or older
$1000 + $200 x number of tickets
Print the person’s age, number of tickets and the computed insurance cost.
2. Write a program to compute the Mileage given by a vehicle.
Mileage = (new_odometer – old_odometer)/(gallons_gas)
Program illustrating how ‘for’ loop works.
3. Program to find the factorial of a number using recursive function
1. Program to compute the car insurance premium for a person based on their age and the number of tickets they have received. The following table explains how to perform the ticket computation: If Person's Age Is: Then Insurance Cost Is- Less than 21
$1500 + $250 x number of tickets
From 21 through 24
$1200 + $250 x number of tickets
25 or older
$1000 + $200 x number of tickets
Print the person’s age, number of tickets and the computed insurance cost. 1. Program to compute the car insurance premium for a person based on their age and the number of tickets they have received. The following table explains how to perform the ticket computation: If Person's Age Is: Then Insurance Cost Is- Less than 21
$1500 + $250 x number of tickets
From 21 through 24
$1200 + $250 x number of tickets
25 or older
$1000 + $200 x number of tickets
Print the person’s age, number of tickets and the computed insurance cost.
2. Write a program to compute the Mileage given by a vehicle.
Mileage = (new_odometer – old_odometer)/(gallons_gas)
Program illustrating how ‘for’ loop works.
3. Program to find the factorial of a number using recursive function

Explanation / Answer

1.

#include <stdio.h>

int main(){
double oldOdometer, newOdometer, gallonsGas;
printf("Enter the old odometer reading: ");
scanf("%lf", &oldOdometer);
printf("Enter the new odometer reading: ");
scanf("%lf", &newOdometer);
printf("Enter the number of gallons: ");
scanf("%lf", &gallonsGas);
double mileage = (newOdometer - oldOdometer) / gallonsGas;

printf("The mileage is: %lf ", mileage);
}

2.

#include <stdio.h>

int main(){
int arr[] = {1, 2, 3, 4, 5};
int sum = 0, i;
for(i = 0; i < 5; i++) {
sum += arr[i];
}
printf("Sum is: %d ", sum);
}

---------------------------------------------

#include <stdio.h>

int main(){
int arr[5];
int sum = 0, i;
for(i = 0; i < 5; i++) {
arr[i] = 2 * (i + 1);
sum += arr[i];
}
printf("Sum is: %d ", sum);
}

3.

#include <stdio.h>

int main(){
int tickets, age;
printf("Enter the age: ");
scanf("%d", &age);
printf("Enter the number of tickets received: ");
scanf("%d", &tickets);
double totalCost = 0;
if(age < 21){
totalCost = 1500 + 250 * tickets;
} else if(age < 24) {
totalCost = 1200 + 250 * tickets;
} else {
totalCost = 1000 + 200 * tickets;
}
printf("Age: %d, Insurance cost: %lf ", age, totalCost);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote