Question: Please Answer All :) Problem Set 1. (5 points) The foot (plural: feet) is one of the most commonly used units of length in today's
Please Answer All :)




Problem Set 1. (5 points) The foot (plural: feet) is one of the most commonly used units of length in today's world. Write an algorithm that takes side lengths of a rectangular field in inches as user input and outputs the area of the field in square feet. The formula for converting inches to feet is: feet - inches/12 Given the lengths of two sides of a rectangle, a & b, we can compute its area as follows, area = a*b 2. (6 points) The zootopia government wants to estimate the number of anthropomorphic animals such as Fox, Bunny and Sloth, that would be living in the city after a certain number of years. Based on this estimate, the city mayor is planning to take the necessary measures for their safety and welfare. Write an algorithm to estimate the number of foxes, bunnies and sloths that would be living after a certain number of years ("X'). x will be taken as a user input. Currently, there are 11000 foxes, 23000 bunnies, and 19000 sloths in zootopia. The government has provided us with the birth and death rates per year (mentioned below) to come up with an accurate estimation. Animal Birth rate Death rate Fox 110 80 Bunny 90 100 Sloth 120 50 3. (8 points) Q3: Good Morning! It's a good-old pre-Covid Saturday morning and your friends have come over to your house. You all decide to bake either bread, cake or cookies. However, you're unsure about whether you have all the ingredients in the required quantities. The recipes are as follows: 1. Bread - 2 cups flour, 1 cup water, 0.5 cup butter 2. Cake - 1.5 cups flour, 2 cups sugar, 1 cup butter 3. Cookies -2.25 cups flour, 1 cup sugar, 0.5 cup butter Write pseudocode for a program that does the following: Prompt the user for how much of each ingredient they have, and then calculate and output the recipes the user is able to make given those ingredients. --- Sample run How much flour (in cups) do you have? -> 3 How much sugar (in cups) do you have? -> 1 How much water (in cups) do you have? -> 2 How much butter (in cups) do you have? -> 0.5 You can make Bread You can make Cookies 4.A. (10 points) You've recently started using a credit card and if you don't pay your credit card balance in full each month, your credit card company will charge you interest every day on the remaining balance. You can calculate how much interest you pay per day by converting your APR (Annual Percentage Rate) to a Daily Percentage Rate by dividing it by 365. Multiply this daily rate with your current balance at the end of each day to get the daily interest charge. Add this charge to your balance the next day, a process called compounding. For instance, if your credit card has an APR of 15%, it will have a daily rate of .041096%. Thus, an outstanding balance of $1000 at the end of the day will become $1000.41096 the next day. This process occurs each day, such that at the end of the month, the initial $1000 balance becomes $1013 when interest charges are applied at 15% APR. Write an algorithm that calculates how many months it takes your balance to reach $1000 if the following are true: 1. Your credit card has an APR of 15% 2. You spend $200 on your credit card per month 3. You pay the minimum balance of $50 per month, but no more 4. Each month has 30 days 4.B. (5 points) Make changes to the above algorithm so that the user can input values for APR, spending each month, and how much they pay off each month. Is there a scenario where the algorithm will not terminate (maybe enter an infinite loop)? If so, make changes to the algorithm so that it always terminates
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
