Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2, Problem 20PS
What is the type of each of the following constants?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the followings is the valid data type in C
programming language?
a. char
O b. None of these
c. Int
O d. Double
66.
Operators with the same precedence are evaluated in which manner?
a.
Left to Right
b.
Right to Left
c.
Can’t say
d.
None of the mentioned
Hi, I need the answer to this question using the C++ programming language. Thank you.
Question:
Falling Distance
When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:
d = 1/2gt2
The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling.
Write a function named fallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value.
Chapter 2 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 2 - The purpose of a header file, such as stdio.h, is...Ch. 2 - Prob. 2PSCh. 2 - The C standard function that receives data from...Ch. 2 - Which of the following statements about the...Ch. 2 - Which of the following statements about block...Ch. 2 - Prob. 6PSCh. 2 - Which of the following is not a data type?...Ch. 2 - The code that establishes the original value for a...Ch. 2 - Prob. 9PSCh. 2 - Prob. 10PS
Ch. 2 - To print data left justified, you would use a in...Ch. 2 - Prob. 12PSCh. 2 - One of the most common errors for new programmers...Ch. 2 - Which of the following is not a character constant...Ch. 2 - Which of the following is not an integer constant...Ch. 2 - Which of the following is not a floating-point...Ch. 2 - Prob. 17PSCh. 2 - Which of the following is not a valid identifier...Ch. 2 - What is the type of each of the following...Ch. 2 - What is the type of each of the following...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - What is output from the following program...Ch. 2 - Prob. 24PSCh. 2 - Find any errors in the following program....Ch. 2 - Find any errors in the following program....Ch. 2 - Prob. 27PSCh. 2 - Prob. 28PSCh. 2 - Prob. 29PSCh. 2 - Code the variable declarations for each of the...Ch. 2 - Code the variable declarations for each of the...Ch. 2 - Write a statement to print the following line....Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses defined constants for...Ch. 2 - Prob. 36PSCh. 2 - Prob. 37PSCh. 2 - Write a program that prompts the user to enter an...Ch. 2 - Write a C program using printf statements to print...Ch. 2 - Write a program that reads a character, an...Ch. 2 - Write a program that prompts the user to enter...Ch. 2 - Write a program that reads 10 integers and prints...Ch. 2 - Write a program that reads nine integers and...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Do in jupyter notebook! I'm not confident of my code please help me out .arrow_forward1.)Which of the following identifier/variable name is considered as invalid? Select one: a. none of the choices b. number c. name d. case 2.)The complete parameter in C used to print the cursor to the next line. Select one: a. printf(“/n”); b. print(“/n”); c. printf(“\n”); d. print(“\n”);arrow_forward0o.the numbers are of type int and Scanner must be use.arrow_forward
- (a) Write two different techniques to declare and initialize a variable with an example. (b) Write a program that simulates a simple cakulator. It reads two integers and a character. If the character is a +", the sum is printod; if it is a -', the difference is printed; if it is a *, the product is printed; if it is a ", the quotient is printed; and if it is a "%", the remainder is printed.arrow_forwardCODE USING C++ There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 inputted values and print out the result. Go and search for the positive ones among these four! Input A line containing four numbers (may contain decimal places) separated by a space. 2·-4·3.6·1 Output A line containing the total number of positive integers. 3arrow_forwardMark all options that are good names for variables in Python. a. b. C. O d. O e. test#1 _test_1 1_test t_1_est test_1arrow_forward
- 7Code write please. Write a program to request for three number, your program should determine: i. the largest of the number ii. the average of the numbers You NB: the numbers are of type int and Scanner must be used. b. The electoral commission of Ghana is trying to find out the eligibility of voters in the country, on a trial bases you were tasked to come out with a program that request for: i. A person's country of residence; ii. The person's age; iii. The person should be eligible to vote if he comes from Ghana and is at least 18 years of age. NB: country and age should be declared as string and float respectively, You can use either "Scanner of JOtionPane" to collect the variables bor 1 of 1 125 words DR English (United States).arrow_forwarddo it fastarrow_forward2.arrow_forward
- 4. A variable should hold all the letters of the alphabet. Which data type should the variable be? A.Integer B.Float C.String D.Booleanarrow_forwardQ2/ Complete the time expressions with for or since. half an hour a long time October last Tuesday a couple of weeks 2001 ten o'clock I was 14 three monthsarrow_forward5. How Many Times? by Jemar Jude Maranga Jennie is an ice cream parlour owner. She only sells 9 different type of ice creams. The ice creams are labelled from number 1 to 9. In order to keep track of which ice cream type sells a lot, she hired her friend Lisa to make a program that will show the ice cream number(s) which were ordered more than once. Input A single line containing the ice cream numbers that were ordered. Treat as one number. 12116744 Output Shows the ice cream type that were ordered more than once. Prints "No repeated order", if all ice cream type wasn’t ordered more than once. Ice·cream·1·was·ordered·3·times Ice·cream·4·was·ordered·2·timesarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License