Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

20 Points Due: Wed. 01/24/18, 11:50 pm Objectives: . Introductory Comments . Data types & variables scanf O function Program: Write a C program to

image text in transcribed
image text in transcribed
image text in transcribed
20 Points Due: Wed. 01/24/18, 11:50 pm Objectives: . Introductory Comments . Data types & variables scanf O function Program: Write a C program to do the following tasks-write the code in the main function.. a) Declare variables for today's low and high temperatures (whole numbers), variables to store price of the gas at the pump for regular, silver and premium grade (real numbers); variables to store the year, month and day of a birthdate (whole numbers). Declare each variable on a separate line with meaningful name. b) Display your full name, email address, CNIT105 Assignment-02 in a box of stars. c) Prompt the user to enter today's high temperature. d) Read it into the variable declared for this purpose. e) Prompt the user to enter today's low temperature. f) Read it into the variable declared for this purpose. g Display today's low and high temperature to the screen. h) Prompt the user to enter price of the regular gas at the pump. Read it into the variable declared for this purpose. i) Prompt the user to enter price of the silver grade gas at the pump. Read it into the variable declared for this purpose. j) Prompt the user to enter price of the premium gas at the pump. Read it into the variable declared for this purpose. k) Display the price of three grades of gas at the pump in a tabular format to the screen - as shown in the screen capture. Display prices with 3 digits after the decimal point and a dollar sign ( $%. Prompt the user to enter a birth date; the year, followed by the month, followed by the day (whole numbers). Use one prompt (one printf). I) m) Use one scanf () to read all three values into variables. n) Display the birthdate with a descriptive message, see the screen capture. Introductory Comments: At the beginning of the source code, include the following information which is referred to as introductory comments. Programmer: Your name Email: Your email CNIT 105, Assignment-02 Lab Session Time: Program Description: A brief description in your own words

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Prepare an electronic rsum.

Answered: 1 week ago

Question

Strengthen your personal presence.

Answered: 1 week ago

Question

Identify the steps to follow in preparing an oral presentation.

Answered: 1 week ago