STARTING OUT W/PROGRAM.LOGIC...-TEXT
5th Edition
ISBN: 2810022369454
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 12, Problem 3MC
If the str variable contains the string "berry", which pseudocode statement changes its contents to "blackberry "?
- a. Set str[O] = "black"
- b. Set str = str + "black"
- c. insert(str, 0, "black")
- d. insert(str, 1, "black" )
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
= "welcome everybody"
Dim str As String
Dim str2 As String
For i
str2 &= str.Chars(i) & str.Substring(i, 3).StartsWith("e")
str.Length
3 To 3 Step -4
%3D
Next
MsgBox(str2)
oFalseeTruee True
dfalserfalse false
ofalseefalseetrue
none
Program file: ccurve. py
Author: Ken
This program prompts the user for the level of
a c-curve and draws a c-curve of that level.
IL II||
from turtle import Turtle
def cCurve(t, x1, y1, x2, y2, level):
def drawLine(x1, у1, х2, у2):
"""Draws a line segment between the endpoints.
t.up()
t.goto(x1, y1)
t.down ()
t.goto(x2, y2)
IL II||
if level
== 0:
drawLine(x1, у1, х2, у2)
else:
y2) // 2
х1) // 2
СCurve(t, x1, у1, хт, уm, level
хm, ут, х2, у2, level
xm = (x1 + x2 + y1
(x2 + y1 + у2
ym =
1)
1)
cCurve(
def main():
level =
int(input("Enter the level (0 or greater): "))
Turtle()
t.hideturtle()
cCurve(t, 50, -50, 50, 50, level)
t =
main()
Pls debug this pseudocode
// Program lets user input scores on four tests// Average is computed and letter grade is determined// Letter grades are based on 90 for an A, 80 for a B, and so onstart string name num score num NUM_TESTS = 4 num NUM_RANGES = 5 num RANGES[NUM_RANGES] = 90, 80, 70, 60, 0 string QUIT = "ZZZZZ" string GRADES[NUM_RANGES] = "A", "B", "C", "D", "F" num total num average num sub output "Enter student name or ", QUIT, " to quit " input name while name <> QUIT sub = 0 total = 0 while sub < NUM_TESTS output "Enter score " input score total = score endwhile sub = 0 while average < RANGES sub = sub + 1 endwhile letterGrade = GRADES[sub] output name, letterGrade output "Enter student name or ", QUIT, " to quit " input lettergrade endwhilestop
Chapter 12 Solutions
STARTING OUT W/PROGRAM.LOGIC...-TEXT
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...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Solution to Programming Project 15.10 Listed below is code to play a guessing game. In the game two players att...
Problem Solving with C++ (9th Edition)
Repair Bill Suppose automobile repair customers are billed at the rate of per hour for labor. Also, suppose co...
Introduction To Programming Using Visual Basic (11th Edition)
What is the disadvantage of having too many features in a language?
Concepts Of Programming Languages
Describe a method that can be used to gather a piece of data such as the users age.
Web Development and Design Foundations with HTML5 (8th Edition)
What is the difference between a protected class member and a private class member?
Starting Out with Java: From Control Structures through Objects (6th Edition)
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
- 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 wordsarrow_forward#include #include #include #include // REFERENCE // http://www.cplusplus.com/reference/cstdio/ // http://www.cplusplus.com/reference/cstring/ int main(void) { // create a 50 character string named s1 and initialize it to // "This is test string 1!!" // create a 100 character string named s2 // print string s1 followed by a new line // use a while loop and a character function to count the alphabetic characters in s1 // and print the result as: "# of alphabetic characters: \n" //use for loop and a character function to count the words in the word return (0);arrow_forwardIf String str1 = new String("Final Exam");, the value of str1.indexOf('x') isarrow_forward
- Q: People often forget closing parentheses when entering formulas. Write a program that asks the user to enter a formula and prints out whether the formula has the same number of opening and closing parentheses. Q: Write a program that asks the user to enter a word and prints out whether that word contains any vowels. Q: Write a program that asks the user to enter a string. The program should create a new string called new_string from the user’s string such that the second character is changed to an asterisk and three exclamation points are attached to the end of the string. Finally, print new_string. Typical output is shown below: Enter your string: Qbert Q*ert!!! Q: Write a program that asks the user to enter a string s and then converts s to lowercase, removes all the periods and commas from s, and prints the resulting string. Q: Write a program that asks the user to enter a word and determines whether the word is a palindrome or not. A palindrome is a word that reads the same…arrow_forwardName format: You must use String object and not StringBuffer or StringBuilder. Many documents use a specific format for a person's name. Write a program that take one Line as an input. Example: Scanner input = new Scanner(System.in); System.out.println(“Enter firstName middleName lastName separated by at least one blank, It may have more than one blank separating firstName middleName lastName."); Input sample : Pat Silly Doe || Note these are separated by at least one blank. String line = input.nextLine() Ex: If the input is: Pat Silly Doe the output is: Doe, P.S. If the input has the form: firstName lastName the output is: lastName, firstInitial. Ex: If the input is: Julia Clark the output is: Clark, J. Please submit the .java source file and the sample run in a text file. Thanksarrow_forwardFunction strlen() takes a string as an argument and returns the number of characters in the string, Which of the following is the correct answer to fill the above statement with it? Select one: a. Spaces are not included in the length calculation b. Null character is not included in the length calculation c. Numbers are not included in the length calculation d. Null character is included in the length calculationarrow_forward
- Assume the variable name references a string. Write a for loop that prints each character in the string.arrow_forwardUsing a for Loop Summary In this lab the completed program should print the numbers O through 10, along with their values multiplied by 2 and by 10. You should accomplish this using a for loop instead of a counter- controlled while loop. Instructions 1. Write a for loop that uses the loop control variable to take on the values O through 10. 2. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. 3. Execute the program by clicking the Run button at the bottom of the screen. Is the output the same?arrow_forwardQI / Select the correct answer: 1- The programmer use a) Text property to refer to menu element in code. c) Name b) Code d) Element 2- To add input box in VB the required code is: a) input box ("prompt or remark"," title") b) X input box (prom'pt or remark, title) c) d) input box (prompt or remark, title) d) X= input box ("prompt or remark"," title") 3- The variables that does not change the value during execution of program is.. c) Numeric a) constant b) string d) All of the above 4- Visual Basic responds to events using which of the following? a) a code procedure b) a form procedure c) an event procedure d) a property 5- Function used to Convert variable to string. a) Cstr(x) b) Val(x) c) Cint(x) d) int(x)arrow_forward
- Option #1: String Values in Reverse Order Assignment Instructions Write a Python function that will accept as input three string values from a user. The method will return to the user a concatenation of the string values in reverse order. The function is to be called from the main method. In the main method, prompt the user for the three strings.arrow_forwardAssume names is a variable that references an array of 20 string values. Write a foreach loop that displays each of the elements of the array in a ListBox control.arrow_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_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming Tutorial 36 - Intro to Loops; Author: Caleb Curry;https://www.youtube.com/watch?v=M3o7Y0juEP0;License: Standard YouTube License, CC-BY