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 (

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.

Essays

Essay Writing Services

At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .

Admissions

Admission and Business Papers

Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.

Editing

Editing and Proofreading

Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..

Coursework

College Essay Writing

In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.