Concept explainers
Every complete statement ends with a __________.
- a. period
- b. parenthesis
- c. semicolon
- d. ending brace
The complete statement ends with “semicolon (“;”)”.
Hence, the correct answer is option “C”.
Explanation of Solution
Semicolon (;):
Semicolon is a type of command in Java.
- The semicolon is used to indicate to the compiler that the command ends here.
- Semicolon is used as delimiter in Java to intentionally separate a command from the following Java command.
- If a semicolon is missed in any of the statements, then the program produces an error.
Example for the purpose of Semicolon (;):
//Declare and initialize the variables
double value1 = 28;
double value2 = 32;
double value3 = 37;
The above three variable declaration statements are all individual commands separated by the semicolon.
Explanation for incorrect options:
a. Period:
Period is used differentiate an integer value and decimal value, the value with the period is considered as decimal value.
Hence, the option “A” is wrong.
b. Parentheses:
Parentheses are the symbol used to group the statements in if statement, loop or any other control structures.
Hence, the option “B” is wrong.
d. Ending brace:
Braces are used to represent a block of code, ending brace represents that the block of code ends there.
Hence, the option “D” is wrong.
Want to see more full solutions like this?
Chapter 2 Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Additional Engineering Textbook Solutions
Java How To Program (Early Objects)
Starting out with Visual C# (4th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out with Java: Early Objects (6th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out With Visual Basic (7th Edition)
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }arrow_forwardProgramming Assignment: Car Repair For this programming assignment, create a car repair program that prompts the user to enter information about a customer, the customer's vehicle, and the work performed on the customer's vehicle. Your program should then display the final car repair bill on the computer screen. Your program should accomplish the following: 1. Prompt the user to enter the following information: a. Information about the customer (name, street address, city, state, zip code, phone number). b. Information about the customer's vehicle (make, model, year). c. Information about the work performed (brief description, labor hours needed, cost of parts). 2. Use a labor cost amount of $100.00 per hour and a sales tax rate of 7.0%. 3. Calculate the following: Variable subtotal sales tax total repair bill amount Formula subtotal = labor cost per hour * number of labor hours sales tax = sales tax rate * subtotal total repair bill amount = subtotal + sales tax 4. A screen shot of a…arrow_forwardc# Danielle, Edward, and Francis are three salespeople at Holiday Homes. Write an application named HomeSales that prompts the user for a salesperson initial (D, E, or F) input as a string. Either uppercase or lowercase initials are valid. While the user does not type Z, continue by prompting for the amount of a sale. Issue the error message "Sorry - invalid salesperson" for any invalid initials entered. Keep a running total of the amounts sold by each salesperson. After the user types Z or z for an initial, display each salesperson’s total, a grand total for all sales, and the name of the salesperson with the highest total unless there is a tie. If there is a tie, indicate this in the program's output with the message: "There was a tie". An example of the program is shown below: Enter a salesperson initial >> D Enter amount of sale >> 10 Enter next salesperson intital or Z to quit >> d Enter amount of sale >> 2 Enter next salesperson intital or Z to quit…arrow_forward
- For an if statement to conditionally execute a group of statements, the statements must be enclosed in a set of __________.arrow_forwardThe ___________iteration statement specifies that a statement or group of statements is to be executed repeatedly while some condition remains true.arrow_forwardi uploaded the screenshot please help me to do pseudocode And do flowchart should be in c++arrow_forward
- 10. The assignment operator has a very _____ priority and it associates from _____. a) high, right to left b) low, left to right c) high, left to right d) low, right to leftarrow_forwardC#: Please helparrow_forwardI.4. Usually a _________ indicates to a program the end of a data structure. a) backslash characterb) forward slash characterc) null referenced) null pointerarrow_forward
- The _________ function returns true if the character argument is uppercase.arrow_forwardI need answer in C programming Language Create a program that checks if a password and the repeated confirmation password match according to the following criteria: The password must be at least 8 characters long. The password and confirmed password must match. The password must include at least 1 lowercase character. The password must include at least 1 uppercase character. The password must include at least 1 number. The password must include 1 of the following special characters: ! @ # $ ? In your code, create a function which accepts two character arrays representing the password and repeated password. If the password entered does not meet the requirements listed above, the function should return 1. If the password meets all the requirements, return 0. In main, print a statement indicating the result after the password checking function is called. Other Requirements Your code must use consistent formatting and spacing. Points will be taken off for inconsistent or sloppy code.…arrow_forwardq → r r Therefore, q. -- This is an example of a _______ statement.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning