Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 12, Problem 3DE
Program Plan Intro
Syntax error:
An error which occurs on the source code of a
Compilation error:
It is an error which occurs when a compiler fails to compile the program due to some errors. This type of error helps the coder to debug the program code for some possible errors.
Logical error:
Logical error prevents the program from performing, because of the errors in the logical statements.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1.
This program reads one number, as a string, and assign it to String getData
Increment and display getData as integer and double
Only strings are to be read
2.
This program reads strings only
Read ten digits, such as 2345678923
store them in getData, which is a string
Display each value and it position in the string
Create aC++ function named countWords that counts the number of words in the current string and displays a message stating how many words are in the string
Examples: The string 2015 has zero words
The string "Hello World" has two words
The string " I am Woman " has 3 words
Max Number
Budi, Anto and Hani are playing a game called Max Number. Budi will ask Anto to say N numbers to put into a bag and also ask Hani to say M numbers and remove that number from the bag and next they will find the maximum number from the bag.
Format InputThe first line contains two integers N stating total numbers that will be stored into bag and M stating the total numbers that want to be removed from the bag. The second lines contains N numbers that will be stored into the bag. The third lines contains M numbers that want to be removed from the bag.
Format OutputOutput with a format “Maximum number is X”, where X is the maximum number in the bag. If no numbers in the bag, the application will give an output “Maximum number is -1”
Constraints• 1 ≤ N ≤ 100• 1 ≤ M ≤ N• 1 ≤ numbers ≤ 999
Sample Input 1 (standard input)10 399 20 10 8 99 4 9 93 66 5599 94 10
Sample Output 1 (standard output)Maximum number is 93
Use C Language.
Chapter 12 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Ch. 12.2 - Prob. 12.1CPCh. 12.2 - Prob. 12.2CPCh. 12.2 - Design an algorithm that determines whether the...Ch. 12.2 - Design an algorithm that determines whether the...Ch. 12.2 - Prob. 12.5CPCh. 12.2 - Prob. 12.6CPCh. 12 - Prob. 1MCCh. 12 - Prob. 2MCCh. 12 - If the str variable contains the string "berry",...Ch. 12 - If the str variable contains the string "Redmond",...
Ch. 12 - Prob. 5MCCh. 12 - Prob. 1TFCh. 12 - Prob. 2TFCh. 12 - If the String variable str contains the string...Ch. 12 - The insert library module automatically expands...Ch. 12 - Prob. 5TFCh. 12 - Prob. 6TFCh. 12 - Prob. 7TFCh. 12 - Prob. 1SACh. 12 - If the following pseudocode were an actual...Ch. 12 - Prob. 3SACh. 12 - Prob. 4SACh. 12 - Prob. 5SACh. 12 - Design an algorithm that counts the number of...Ch. 12 - Prob. 2AWCh. 12 - Design an algorithm that counts the number of...Ch. 12 - Design an algorithm that deletes the first and...Ch. 12 - Design an algorithm that converts each occurrence...Ch. 12 - Design an algorithm that replaces each occurrence...Ch. 12 - Assume the following declaration exists in a...Ch. 12 - Prob. 1DECh. 12 - Prob. 2DECh. 12 - Prob. 3DECh. 12 - Prob. 1PECh. 12 - Sentence Capitalizer Design a program that prompts...Ch. 12 - Prob. 3PECh. 12 - Sum of Digits in a String Design a program that...Ch. 12 - Prob. 5PECh. 12 - Alphabetic Telephone Number Translator Many...Ch. 12 - Word Separator Design a program that accepts as...Ch. 12 - Pig Latin Design a program that reads a sentence...Ch. 12 - Prob. 9PECh. 12 - File Encryption File encryption is the science of...Ch. 12 - File Decryption Filter Design a program that...Ch. 12 - Password Weakness Detector Design a program that...
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
- Assume the variable name references a string. Write a for loop that prints each character in the string.arrow_forwardThe strlen function returns the size of a string, in bytes Select one: True O Falsearrow_forwardExercise#1: Number Sequence Using nested loops, continue and break, write a program that prompts the user to input data for five students. Each student's data contains student first name and test scores. The program should accept positive integers only for test scores and ignore non-positive integers. Each student may has a different number of test scores; the program should receive input for test scores until input "0". Finally, the program outputs each student name with the sum of his/her marks. Sample Input/Output: Enter Student name: Khaled 65 78 -40 56 -25 89 0 The student 'Khaled' has the total marks = 288 Enter Student name: Kamal 37 55 44 -77 22 18 56 26 0 The student 'Kamal' has the total marks = 258 Enter Student name: Ali 66 33 87 66 87 -25 25 39 78 0 The student 'Ali' has the total marks = 481 Enter Student name: Taher 72 67 -33 0 The student 'Taher' has the total marks = 139 Enter Student name: Ahmed 75 68 84 -18 90 0 The student 'Ahmed' has the total marks = 317…arrow_forward
- Lab Activity for the students: Exercise 5: Write a program that asks the user to input a letter. The program finds and prints if the letter is uppercase or lowercase. Then, the program asks the user to input a string and get a three-character substring from the beginning of the string. (1 Mark ) Example : If the inputs are 'y' and "Community". Then, the program will print: y is lowercase The substring is: Comarrow_forwardCount the vowels in a string Create a function in Python that accepts a single word and returns the number of vowels in that word. In this function, only a, e, i, o, and u will be counted as vowels - not y.arrow_forward10. Exercise 9 - Strings (Assessed Exercise) Important: Do not attempt this exercise before completing Exercises 6, 7 and 8. Think how to reuse the functions you created in Exercises 6, 7 and 8. Design and Problem Solving: Create an algorithm for a program that reads a string with a maximum length of N from the keyboard (N should be specified by the user). N should not be more than 100. The algorithm should then copy the characters from that input string into a second character array (in the order of input). However, a character will be copied into the second array only if it is a vowel (i.e., a, e, i, o, u). This second array should be allocated dynamically and its size will depend on the number of characters that will be copied into it. Murdoch UNIVERSITY Once copied, the algorithm should output the values stored in the second string. The algorithm should then count and display the number of times each vowel appears in the second array. Also, the algorithm should determine and output…arrow_forward
- The midfix of 5 is the middle five characters of a string. Given a string input, output the middle five characters of that string with a new line at the end. Assume the string length is always odd and at least five characters. Hint: Use a loop to traverse the string. Ex: If the input is: xxxplanexxx the output is: Midfix: plane 1 #include 2 #include 3 4 int main(void) { 456 char s[100]; 7 char result[6]; SENES000 10 11 12 13 } 14 // buffer for string input // buffer for string output /* Type your code here. */ return 0;arrow_forwardLearning Objectives: Python Programming Use loop over a stringReplace characters within a stringFunction (declaration and call)Write code in modular formInstructions Create a function only_chars that takes the line of text and returns the text line excluding the spaces, periods, exclamation points, or commas. Create a program that will read the input line, use the function, and then print the line, without spaces, periods, exclamation marks, or commas and their length. Ex: If the input is: Listen, Mr. Jones, calm down. the output is: ListenMrJonescalmdown21Do not forget if __name__ == "__main__" section!arrow_forward17. Math Tutor Write a program that can be used as a math tutor for a young student. The program should display two random numbers to be added, such as 247 +129 The program should then pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display the correct solution: 247 +129 376arrow_forward
- The variable data refers to the string "No way!". The expression data[3:6] evaluates toarrow_forwardFunction SubStr( St As String) As String Sum=1 for x=l to 8 if x mod 2 = 0 then S=Mid(St, x, x*2) Else S=Mid(St, x, x+2) End if Next x SubStr=S End Function Sub Cmd_Click() Label.text= SubStr("Phones:987456124123456744") End Sub 987456124 :9874561241 9874561241 98745612412arrow_forwardI1 This program determines whether the user's input is a single er 12 Text Processing 2. What is wrong with the following pseudocode? a Il digit. Declare Integer digit I1 Get the input from the user. Display "Enter a single digit." Input digit // Determine if the input is a single digit. If isDigit (digit[0]) AND length(digit) == 1 Then Display digit, " is a single digit." Else Display digit, "is NOT a single digit." End Ifarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,