Select Page

CSE 310 University of North Texas Create and Use the Following Functions Program

Question Description

All the question should be completed by yourself. Please look at the uploaded file for proper format.

Problem 1 (18 points) -Write functions Submit a program called: direct_functions.c1. Create a function called leapyear() that takes an integer (a year) and returns 1 if the year is leap yearand 0 if it is not. For example, a line of code like printf(leapyear(2020)); in the main function shouldoutput 1 to screen.2. Create a function called three_nums() that takes an array of three integers. The function should return1 if they are in increasing order (from left to right) and 0 otherwise. For example, a line of code likeprintf(three_nums(three_ints)); where three_ints is an array {4, 10, 12} in the main function shouldoutput 1 to screen.3. Create a function called print_out() that takes an integer parameter, a char and a string and prints outa box using the given char. The top and bottom part of the box should have as many chars as theinteger parameter given and the sides of the box should be half of the integer parameter given. TheString given should be printed in the middle of the box. For example, a line of code like print_out(10,‘*’, “Hello”); in the main function should output to screen the box given below. If the String given islonger than the integer given or the integer given is not an even number, “Can’t print this :(” should beoutput to screen.*********** ** ** Hello ** ** ***********4. Create a main function using these functions. Your main function should only contain three lines(along with the declaration of three_ints used below):printf(leapYear(2020));printf(three_nums(three_ints));print_out(10, ‘*’, “Hello”);Problem 2 (20 points) –Give answers Submit a file called: Answers.docConvert the following binary numbers to decimal, hexadecimal and quaternary (SHOW YOUR WORK-You canhandwrite it if you want and scan it as long as it is readable):10001002101111112Convert the following hexadecimal numbers to decimal, binary and octal (SHOW YOUR WORK):1348F16AB71116Convert the following decimal numbers to binary, hexadecimal and senary (SHOW YOUR WORK):781098010What is the maximum value that can be held in the following situations? NOTE: give the maximum value indecimal and SHOW YOUR WORK_ _ _ (hexadecimal, duodecimal, tridecimal)A byte, in a world where a bit allowed for four unique digits (instead of two)Problem 3 (62 points) -Write a Program Submit a program called: lifestyle.cYou and your roommate split expenses (a car payment-$450.50, electricity-$90.00, rent-$1800.00, groceries-$400.00, going out-$500.00). As of right now, you make $4000.50 a month and your roommate makes$3000.25 a month, with you currently paying 60% and your roommate paying 40%. Create a program thatoutputs the amount paid per month for you and your roommate. After each month is printed out, the userhas the option to: add to a savings account or have a life change (see sample run).The program should output for every month and year:• The payment total• How much you and your roommate pay (based on the split-for example, you pay 60% of the bill andyour roommate pays 40%)After all bills have been paid, if there is a leftover amount from you and your roommate’s income, you havethe option to put the leftover into savings (see sample run). After this point, you have the option to:1. Continue to the next month2. Make a life changea. This means you can change the split or update your incomei. If you update the split in payment, the program should make sure that it is a correctsplit. For example, if you try to update it to 30% and 30%, that won’t work because 40%would be missingii. If you update income, the program should check that you (or your roommate) still haveenough to pay your share (the given split) of the bills. If the income update causes youor your roommate to not be able to pay the agreed-on split of the bills, the programshould ask if you are sure you want to make this update. If the answer is yes, theprogram should exit (see sample run 2).iii. If the update has been successfully made, the program should continue to the nextmonth3. Buy something using savingsa. This means you can type in an item you want to buy, along with the price, and deduct it fromsavings (if you have enough). If you don’t have enough, the program should let you know andcontinue to the next month.4. Exita. You can choose to exit the program (so note that the only two ways to exit are to either selectto exit on this menu OR if you don’t have enough income to pay your split of the bills)b. Note that the program should keep going otherwise for as long as possible (for example, youmight see the month March 2025 if start at year 2020 because the program keeps running)You MUST USE THE FOLLOWING to hold information (or you get 0 credit, even for the completion grade):char monthly_expenses[5][20] /*this should hold the 5 names for expenses*/float expenses_money[5] /*how much each expense given above is*/float monthly_payments_income[2][2] /*first element-the split in payment {you, roommate}. Second element-{your monthlyincome, your roommate’s monthly income}*/You MUST CREATE AND USE THE FOLLOWING FUNCTIONS (or you get 0 credit, even for the completiongrade): Additionally, feel free to make additional functions/*This function should print out the expenses to screen and return the total amount of money left over after all bills are paid (

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now