Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to round up the answer to 3 significant figure in c programming language?IE 1 0 0 5 AY 2 3 / 2 4 Special

How to round up the answer to 3 significant figure in c programming language?IE1005 AY23/24 Special Terms
Practical Exercise Assessment 1
Write a C program that takes two positive real numbers from the user as the base edge, a, and height, h, of a right square pyramid. See Figure 1. The program should then print on the screen the following information in a well-formatted tabular arrangement.
Base area of the pyramid, AB, in 3 significant digits.
Surface area of the pyramid, AS, in 4 significant digits.
Volume of the pyramid, V, in 4 significant digits.
Figure 1: A right square pyramid with its base edge, a, height, h.
Use the following formulae for the base area, surface area, and volume:
AB=a2,
AS=a2+2a14a2+h2,2
V=13a2h.
Ensure that your program works for all valid user inputs. Print the results in suitable formats and alignments for a good output visual. Style your code accordingly.
For the submission:
Save your file using YourName.c (without any space characters) as the file name.
Submit only YourName. c in NTULearn. If you need to resubmit, rename your new file as YourName1.c. For subsequent resubmissions, rename as YourName2.c and so on. Only the last file submitted before the due will be graded.
Marking schedule
Prompt the user and take the inputs.
Calculate the base area, surface area, and volume.
Print the results in a well-formatted tabular arrangement.
Keep good coding style (indentation, headers, variable names, etc.).
Total
2 mark
4 mark
3 mark
1 mark
10 mark
image text in transcribed

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

What is one of the skills required for independent learning?Explain

Answered: 1 week ago

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago