[Solved] ECS30 Assignment #1

$25

File Name: ECS30_Assignment__1.zip
File Size: 178.98 KB

SKU: [Solved] ECS30 Assignment #1 Category: Tag:
5/5 - (1 vote)

Exercise 1: vim Tutorial

Complete the vim Tutorial under Piazza->Resources.

File to submit to Gradescope: rain.txt

Problem 1: annualincome.c

Write a program that reads in an hourly wage and calculates the total income over the course of an entire year assuming 40 hours of work a week every week of the year. Example output:

[[email protected] ]$ ./annualincome What is your hourly wage? 5.00

Your total income over a year is 10400 dollars and 0 cents

[[email protected] ]$ ./annualincome

What is your hourly wage? 18.33

Your total income over a year is 38126 dollars and 40 cents

File to submit to Gradescope: annualincome.c

1

Problem 2: finalgrade.c

Write a program that calculates your final grade. Your program will read your current grade (out of 100 points), the value of the final as a percentage, and your final exam score (out of 100 points) from stdin and compute your final grade as a percent. All numbers should be whole numbers. Round up fractional final grades. Example output:

[[email protected] ]$ ./finalgrade

What is your current grade? 76

How much is the final worth? 20

What is your final exam score? 96

Your final grade is 80%

[[email protected] ]$ ./finalgrade

What is your current grade? 100 How much is the final worth? 20

What is your final exam score? 77

Your final grade is 95%

File to submit to Gradescope: finalgrade.c

Problem 3: primerib.c

Chef John Mitzewich of Food Wishes fame recommends the following method to cook prime rib, which he affectionately calls Method X[2] . You have a prime rib that weighs x pounds. Chef Mitzewich orders you to cook your rib at 500 degrees Fahrenheit for 5x minutes, turn off the oven (do not open the door), and let the rib continue to cook in the oven for 2 hours. Write a program that outputs the total time that a rib weighing x pounds is in the oven with the following format:

Your rib will be in the oven for h hours, m minutes, and s seconds.

You must have h0, 0m59, and 0s59. Example output:

[[email protected] ]$ ./primerib

How many pounds is your prime rib? 3.75

Your rib will be in the oven for 2 hours, 18 minutes, and 45 seconds.

[[email protected] ]$ ./primerib

How many pounds is your prime rib? 5.35

Your rib will be in the oven for 2 hours, 26 minutes, and 45 seconds.

File to submit to Gradescope: primerib.c

2

[1] Last updated January 8, 2017

[2] No, really, this is a recipe, and it works.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] ECS30 Assignment #1[Solved] ECS30 Assignment #1
$25