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 5PS
Which of the following statements about block comments is false?
a. Comments are internal documentation for programmers.
b. Comments are used by the preprocessor to help format the
c. Comments begin with a /* token.
d. Comments cannot be nested.
e. Comments end with a */ token.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
3- Write a program that reads your birthday (day-month-year).
Calculate your age in (day - month - year). Hint: remember, you will
benefit from the current date.
python:
def shakespeare_position(role, section): """ Question 2 - Regex
You are reading a Shakespeare play with your friends (as one frequently does) and are given a role. You want to know what line immediately precedes YOUR first line in a given section so that you are ready to go when it is your turn. Return this line as a string, excluding the character's name.
Lines will always begin with the character's name followed by a ':' and end in a "." or a "?" Each line is separated by a single space.
THIS MUST BE DONE IN ONE LINE.
""
Args: role (str) section (str)
Returns: str
section_1 = 'Benvolio: By my head, here come the Capulets. Mercutio: By my heel, I care not. ' + 'Tybalt: Gentlemen, good den - a word with one of you. Mercutio: And but one word with one of us?'
>>> shakespeare_position('Tybalt', section_1) 'By my heel, I care not.' >>> shakespeare_position('Mercutio', section_1) 'By my head, here…
Task 1: Working with the cout StatementExercise 1: Retrieve program name.cpp from the Lab 2 folder.Fill in the code so that the program will do the following:Write your first and last name on one line.Write your address on the next line (recall the function of the endl statement).Write your city, state and zip on the next line.Write your telephone number on the next line.Remember that to output a literal, such as “Hello”, you must use quotes.Compile and run the program.Example: Deano Beano123 Markadella LaneFruitland, Md. 55503489-555-5555The code for name.cpp is as follows:
// This program will write the name, address and telephone// number of the programmer.// PLACE YOUR NAME HERE#include <iostream>using namespace std;int main(){// Fill in this space to write your first and last name// Fill in this space to write your address (on new line)// Fill in this space to write you city, state and zip (on new line)// Fill in this space to write your telephone number (on new line)return…
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
- Fill the box with the correct answerarrow_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_forward9. Write a program that reads from the user a sentence. The program should count the number of occurrences of the character 'a' in the sentence. 10. Write a program that reads from the user 10 words. The program then should count and print the number of words that start with character 'a'.arrow_forward
- Q3: Write a computer program in FORTRAN 90 to input the coordinates (x and y) of n points. The program check each one to be lies in the second quarter (the program prints "the point lies in the second quarter") or not (the program prints "the point lies out of the second quarter").arrow_forwardWhat is the output of the following code segment?inta=3,b=4;if(a==b);Write(X);Write(Y); X Y XY nothingarrow_forwardExcercisel: write a program to enter a user name and display the message (hello) three times. The first one for (Mena), the second one for (Nastia) and the third for any user as a guest. (For example, hello mena, hello Nastia et.al.)arrow_forward
- 5- Write a program which read a number consists of 4 digits and find the maximum digit of the number. FOR eg. 1472 the maximum digit is 7 the maximum digit is 9 9835arrow_forwardcan you please do this with java in eclipse ide please thank youarrow_forwardI'm not sure..... Help me. I need each java code.arrow_forward
- Direction: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code. Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommendedarrow_forwardUsing Pythonarrow_forward3. Write a program that picks a random number between 1 and 100 inclusive. It then prompts the user to guess the number. If the user guesses the number, print out a congratulatory message and exit. Otherwise, indicate whether the guess was low or high and ask the user to try again. Hint: Use the rand() function.arrow_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,
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
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