Question

i need #6 but i believe #6 function needs to call #5 function. I would like this in C language, and have no pointers, arrays or strings (on function calling and parameters). Thanks! I have attached the other functions that you might need to call for function 6
5. Write and test a function called print_time_conversion that takes one integer representing a number of seconds. The functi

1. Write and test a function called is_multiple_of that takes a integer n1, integer n2 and determines whether the second argument (n2) is a multiple of the first argument (n1). The function should return 1 if n2 is a multiple of n1, and 0 if it is not. Examples: If the function is called with 2 (n1) and 6 (n2), the function should return 1 because: 6 is a multiple of 2, since 2 divides evenly into 6 If the function is called with 4 (n1) and 6 (n2), the function should return 0 because: 6 is not a multiple of 4 since 4 does not divide evenly into 6. HINT: How do you determine if one number divides evenly into another? What could we do to test to see if a number was even (divisible by 2?)

2. As illustrated in the image to the right, quadrants of a grid are numbered counter clockwise with the upper right quadrant numbered I. A grid has a y-axis and x-axis and where the two intersect is the origin. A point lying on an axis is not considered within a quadrant. Write a function called get_quadrant takes 2 whole numbers representing an (x,y) point of a grid and returns the number of the quadrant that point lies in. If the point lies on an axis, the function should return -1 to indicate it does not lie in a quadrant.

3.Write and test a function called print_zodiac_sign that will take as arguments two numbers: one for the month and one for the day. The function should print the name of the zodiac sign for the specified month and day (you are not printing the image). You can assume the function will be called with values that represent a valid date (ie. you will never get the value 2, 30 as there is no February 30th.

4. Write and test a function called get_seconds that takes three numbers representing a number of days, number of hours and number of minutes. The function should compute and return the number of seconds this amount of time would be in total. Examples: If the function is called with 0 days and 0 hours and 1 minute, the function should return 60 If the function is called with 0 days and 2 hours and 1 minute, the function should return 7260 If the function is called with 1 day and 1 hour and 1 minute, the function should return 90060

0 0
Add a comment Improve this question Transcribed image text
Answer #1

We need to call function 4 for this problem.

function 6 will be like:

float get_distance_traveled ( int days, int hours, float speed)

{

int seconds;

float distance;

seconds = get_seconds( days, hours, 0); // as no minutes will be provided so it will be 0

distance = (seconds * speed)/1000; // converting distance into kilometers

return distance;

}

  

Add a comment
Know the answer?
Add Answer to:
i need #6 but i believe #6 function needs to call #5 function. I would like...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Part 3 (Lab2a) In this exercise you will: a. Write a method called secondTime that takes...

    Part 3 (Lab2a) In this exercise you will: a. Write a method called secondTime that takes as argument an integer corresponding to a number of seconds, computes the exact time in hours, minutes and seconds, then prints the following message to the screen: <inputseconds> seconds corresponds to: <hour> hours, <minute> minutes and <second> seconds Write another method called in Seconds that takes as arguments three integers: hours, minutes and seconds, computes the exact time in seconds, then returns the total...

  • Python 3.4 Human readable time intervals problem I really need help with this problem. I don't...

    Python 3.4 Human readable time intervals problem I really need help with this problem. I don't know how to start and what method will be most helpful and easy. Write the function readable-interval that takes a string consisting of a human-readable time interval Homework #3 CSE 101 Spring 2017 Page 3 and converts it into a list of six integers, given in this order: of years, of months, t of days, #of hours, of minutes, of seconds] The input values...

  • In C please Write a function so that the main() code below can be replaced by...

    In C please Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). Original maino: int main(void) { double milesPerHour, double minutes Traveled; double hours Traveled; double miles Traveled; scanf("%f", &milesPerHour); scanf("%lf", &minutes Traveled); hours Traveled = minutes Traveled / 60.0; miles Traveled = hours Traveled * milesPerHour; printf("Miles: %1f\n", miles Traveled); return 0; 1 #include <stdio.h> 3/* Your solution goes here */ 1 test passed 4 All tests passed...

  • PYTHON QUESTION 2. Write a function called first_day_greater that takes two lists, L1 and L2 ,...

    PYTHON QUESTION 2. Write a function called first_day_greater that takes two lists, L1 and L2 , representing the daily measured weights of rat 1 and rat 2, respectively, and returns the index of the first day for which the weight for the fist rat is greater than the weight of the second rat.If there are no such days then the function should return -1. You may NOT assume that L1 and L2 are the same length. Use the following to...

  • IN C WITH COMMENTS PLEASE, THANKS! Write the void function, convertTime(), which converts a time given...

    IN C WITH COMMENTS PLEASE, THANKS! Write the void function, convertTime(), which converts a time given in only seconds to the associated number of hours, minutes, and remaining seconds. For example, 20,565 seconds is converted to 5 hours, 42 minutes, and 45 seconds. Note: the template does not include the required function prototype, so careful attention must be given to the following instructions to ensure you have the correct format for the function. The function does not return any quantity...

  • In Python 5. Write a function named listComprehensionDivisors that has 3 integer inputs, N, n1, and...

    In Python 5. Write a function named listComprehensionDivisors that has 3 integer inputs, N, n1, and n2. Using a single list comprehension to make a list of all of the numbers in the range 1..N that are either divisible by n1 or n2, where n1 and n2 can be any positive integers. After creating the list, your code should print out the following 2 lines: “We are printing all numbers from 1 to that are divisible by or ” “These...

  • Python Program 5. Write a Python program in a file named validTime.py. Include a function named...

    Python Program 5. Write a Python program in a file named validTime.py. Include a function named string parameter of the form hh:mm: ss in which these are numeric validTime that takes a values and returns True or False indicating whether or not the time is valid. The number of hours, minutes, and seconds must two digits and use a between 0 and 9). The number of hours must be between 0 and 23, the number of minutes and seconds must...

  • In (11): def convert time time in seconds) <Fill in the docstring for this function 0...

    In (11): def convert time time in seconds) <Fill in the docstring for this function 0 # <Add your code below. Note that the return value is currently arbitrary # Note that number format in the format string below> + hours = 5 minutes - 38 seconds = 12 designation - "PM" return "{:62d}: {:02d):{:02dH)".format( hours, minutes, seconds, designation # Tests print( convert time 7)) print convert time 2 • 60 60 + 7)) print( convert time( 12 * 60...

  • Please use Python 3, thank you~ Write a program that: Defines a function called find_item_in_grid, as...

    Please use Python 3, thank you~ Write a program that: Defines a function called find_item_in_grid, as described below. Calls the function find_item_in_grid and prints the result. The find_item_in_grid function should have one parameter, which it should assume is a list of lists (a 2D list). The function should ask the user for a row number and a column number. It should return (not print) the item in the 2D list at the row and column specified by the user. The...

  • C++ Question 6 (10pt): Convert seconds Write a program that takes a number of seconds as...

    C++ Question 6 (10pt): Convert seconds Write a program that takes a number of seconds as user input (as an integer) and converts it to hours, minutes, and seconds as shown below. You should convert the amount of time in such a way that maximizes the whole numbers of hours and minutes. Expected output 1 (bold is user input) Enter a number of seconds: 60 0 hour(s) 1 minute(s) 0 second(s) Expected output 2 (bold is user input) Enter a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT