Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

COMP B13 C Programming The purpose of this assignment is to give you practice writing, compiling, and running a C program that produces output based

image text in transcribed
COMP B13 C Programming The purpose of this assignment is to give you practice writing, compiling, and running a C program that produces output based upon input. SumDouble And Int Your task is to write a program that reads a floating-point number and an integer (in that order) from stdin and prints out the sum in a specified format. Name the program source file SumDouble AndInt.c. (The name and capitalization are important.) Be sure to include a file header comment which includes an appropriate description of the program using the style specified in C Coding Standard. Issue a single prompt, using the EXACT format shown in the example below. . Read the floating-point number into a variable of type double and the integer into a variable of type int. Use the scanf() function to read the input. The format specifier for a double is "X1f". (More info at https://en.wikipedia.org/wiki/Scanf format string) Use the printf( function to produce the formatted output. Format your output EXACTLY as shown in the example below, being sure to include a newline at the end. Specify a precision of 3 digits after the decimal point for the floating-point numbers. The example below depicts how to compile and run your program. Input is shown in green. MyPrompt> gcc -g -Wall SumDoubleAndInt.C - SumDoubleAndInt MyPrompt> /SumDoubleAndInt Enter a floating-point number followed by an integer: 12.345 8 12.345 + 8 = 20.345 Demonstrates that MyPrompt> ./SumDoubleAndInt scanf ignores white Enter a floating-point number followed by an integer: 54.3 space (spaces, tabs and newlines) 54.300 + 66 = 120.300 MyPrompt> 66 WHAT TO HAND IN Upload your source code (SumDoubleAndInt.c) in the assignment page. Don't forget to: Name your source file(s) as specified. Format your code before submission, as specified in C Coding Standard Submit the .c file(s), not the .exe file. Include comments for your code: Author, course name, date, source file name, and a brief description

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

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

Question Can I collect benefits if I become disabled?

Answered: 1 week ago

Question

Question May I set up a Keogh plan in addition to an IRA?

Answered: 1 week ago