Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming Questions to be done Reflection (50%) Instructions Create a text file named reflect.txt Record your answers in the reflect.txt file for each of

image text in transcribed

C programming Questions to be done

Reflection (50%) Instructions Create a text file named "reflect.txt" Record your answers in the reflect.txt file for each of the following: 1. Given the following C statements: printf("10.10 = %.151f ", 10.10); printf("10.12 = %.151f ", 10.12); printf("10.15 = %.151f ", 10.15); Briefly explain why 10.12 doesn't display the value expected? 2. What are all the possible values that can be returned based on the following statements using the modulus operator (you many use a range to simplify your answer): a) intValue % 2 b) intValue %3 c) intValue % 100 3. Apply the modulus operator in the following situation: You are hosting a party and you order 11 pizzas. Each pizza has 12 slices, and the average person eats 3 slices, and you expect 21 people at the party. How many pizza's will be completely consumed and how many extra slices will be needed to feed the expected number of guests? What does the formula look like if you write it in the C language? Fill-in the missing parts (underscored): int totalslices = 11 * 12; int estimatedSlicesConsumed int wholePizzasEaten = int extraSlices Needed = = 21 * 3; 4. Briefly explain why it is often a best practice to convert floating-point values to integers when performing arithmetic operations

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions