subject

Functions IN C LANGUAGE Problem 1
Function floor may be used to round a number to a specific decimal place. The statement
y = floor( x * 10 + .5 ) / 10;
rounds x to the tenths position (the first position to the right of the decimal point). The
statement
y = floor( x * 100 + .5 ) / 100;
rounds x to the hundredths position (the second position to the right of the decimal
point).
Write a program that defines four functions to round a number x in various ways
a. roundToInteger( number )
b. roundToTenths( number )
c. roundToHundreths( number )
d. roundToThousandths( number )
For each value read, your program should print the original value, the number rounded to
the nearest integer, the number rounded to the nearest tenth, the number rounded to
the nearest hundredth, and the number rounded to the nearest thousandth.
Input Format
Input line contain a float number.
Output Format
Print the original value, the number rounded to the nearest integer, the number rounded
to the nearest tenth, the number rounded to the nearest hundredth, and the number
rounded to the nearest thousandth
Examples
Example 1
Input 1
24567.8
Output 1
24567.8 24568 24570 24600

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Assignment directions the owner of a popular local coffee shop has approached you to design a network for his business. he would like to offer his customers wifi access to the internet, but also thinks it might be handy to network the kitchen and store room together with the office computer he already uses for ordering, scheduling, and payroll. he thinks that might save him time doing inventory control and ordering. your assignment is to create a set of questions for him that will precisely define the purpose of the network and any constraints and restrictions on its implementation. assignment guidelines create a list of at least ten questions to ask your customer. of those ten questions, at least one question must come from each of the following subject areas: purpose of the network network access and security issue network availability and fault tolerance issues future expansion issues vendor issues briefly explain in two or three sentences why you would ask each question and what you expect to learn from your customer’s response. submission requirements your questions should meet the criteria of a good survey question by being specific, unambiguous, and closed-ended. all questions, as well as your explanations, should be written in proper english using correct grammar, spelling, and punctuation. use complete sentences, and do not use slang, texting abbreviations, or shortcuts.
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 24.06.2019 11:00
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
Emma is using an artificial intelligence system, which contains information on botany, to identify a type of plant from an image. what type of ai is emma using?
Answers: 1
You know the right answer?
Functions IN C LANGUAGE Problem 1
Function floor may be used to round a number to a specific...
Questions
question
Mathematics, 10.12.2021 05:30
question
Mathematics, 10.12.2021 05:30
question
Mathematics, 10.12.2021 05:30
question
English, 10.12.2021 05:30
question
Mathematics, 10.12.2021 05:30
question
Mathematics, 10.12.2021 05:30
Questions on the website: 13722360