Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS1412, Spring 2023 Programming Principles 2 Lab Assignment 1 Due Tuesday, 312023,11:59 PM [Q1] After studying the population growth of Gotham City in the last

image text in transcribed

CS1412, Spring 2023 Programming Principles 2 Lab Assignment 1 Due Tuesday, 312023,11:59 PM [Q1] After studying the population growth of Gotham City in the last decade of the 20th century, we have modeled Gotham's population function as: P(t)=52.966+2.184t where t is years after 1990 , and P is the population in thousands. Thus, P(0) represents the population in 1990 , which was 52.966 thousand people. Write a program that that predicts Gotham's population in the year provided as an input argument. Enter a year after 1990> 2015 Predicted Gotham City population for 2015 (in thousands): 107.566 [Q2] Tip calculator: Write a c program that calculates the amount of tip per person given bill amount before tax. A tax of 16% will be added to the bill. Your program should input the following information: 1. The bill 2. The percentage of tip that the person wants to pay: (10%,15%, or 20%) 3. The number of persons Your program should output the following information: 1. The tax amounts. 2. The bill after tax 3. tip per person 4. Total per person Sample output Enter the bill ammount 50 Enter number of person 2 Enter tip percentage[ 0.10,0.15,0.20] 0.10 The tax 8.00$ The bill after tax 58.00$ The Tip per person 2.90$ The Amount per person include tip 22.23$ Submission: you should submit: 1) separate c files for question 1 and question 2. 2) screenshots for your output. 3) do not zip your folder

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions