Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming *Notice: I can only edit the part where it says in /* Your solution goes here */ the other part of the code

C Programming

*Notice: I can only edit the part where it says in /* Your solution goes here */ the other part of the code i can't touch it please the solution should be inside that part ad using the code provided

Question 1

Complete the function ConvertToFeetAndInches to convert totalInches to feet and inches. Return feet and inches using the HeightFtIn struct. Ex: 14 inches is 2 feet and 2 inches.

#include

typedef struct HeightFtIn_struct { int feet; int inches; } HeightFtIn;

HeightFtIn ConvertToFeetAndInches(int totalInches) { HeightFtIn tempVal;

/* Your solution goes here */

}

int main(void) { HeightFtIn studentHeight; int totalInches;

scanf("%d", &totalInches); studentHeight = ConvertToFeetAndInches(totalInches); printf("%d feet and %d inches ", studentHeight.feet, studentHeight.inches);

return 0; }

Question2

Complete the function ConvertToWeeksAndDays to convert totalDays to weeks and days. Return weeks and days using the TimeWeekDay struct. Ex: 16 days is 2 weeks and 2 days.

#include

typedef struct TimeWeekDay_struct { int weeks; int days; } TimeWeekDay;

TimeWeekDay ConvertToWeeksAndDays(int totalDays) { TimeWeekDay tempVal;

/* Your solution goes here */

}

int main(void) { TimeWeekDay elapsedDays; int totalDays;

scanf("%d", &totalDays); elapsedDays = ConvertToWeeksAndDays(totalDays); printf("%d weeks and %d days ", elapsedDays.weeks, elapsedDays.days);

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

5. To determine the financial benefits and costs of the program.

Answered: 1 week ago