Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 3DE

The following pseudocode works, but it performs a case-sensitive validation of the user's input. How could the algorithm be improved so the user does not have to pay attention to capitalization when entering a name?

// This program asks the user to enter a string

// and validates the input.

Declare String choice

// Get the user's response.

Display "Cast your vote for Chess Team Captain."

Display "Would you like to nominate Lisa or Tim?"

Input choice

// Validate the input.

While choice != "Lisa" AND choice != "Tim"

Display "Please enter Lisa or Tim."

Display "Cast your vote for Chess Team Captain."

Display "Would you like to nominate Lisa or Tim?"

Input response

End While

Blurred answer
Students have asked these similar questions
Computer Science Godot Programming   Programming Problem 1. Rock, Paper, Scissors This is your traditional rock-paper-scissors game, where two players select one of the three options and a result is produced based on their selection. For reference: Rock beats scissors Paper beats rock Scissors beats paper For this problem, you are to assume that two human players will play against each other and will input their choices accordingly. The input for each player will be in the form of buttons. Once a player clicks on a button, the rest of their buttons are locked in place (i.e. disabled). Once the other player selects their pick, the program outputs who won or if there was a draw. This isn’t exactly the most realistic way to code the game as it would be better if both players made their choice at the same time, but we’ll just have to chalk this up as a limitation for our exam. Aside from the game itself, the program should track the score of each player. Basically, if one wins, that…
USE SCHEME IN DRRACKET.In the language of an alien race, all words take the form of Blurbs. A Blurb is a Whoozitfollowed by between zero or more Whatzits. A Whoozit is the character 'x' followed bybetween one or more 'y's. A Whatzit is a 'q' followed by either a 'z' or a 'd', followed by aWhoozit. -The program should ask the user to “Enter an alien word:”, read the inputas a string, and check whether or not it is a valid word (Blurb). If it is valid, it prints"The word is fine.", otherwise it prints "The word is a mess!". -The program should loop and ask the user for new input until they enter avalid blurb.For Scheme, it is suggested that you review the “input_and_output.rkt” sample program from the first module on functional programming. This program shows how to perform a “loop” that reads in data and processes it. You may find the following forms useful: a. (read) to read a string b. (string->list) to convert the string into a list of characters, c. (display “Hello”) to write…
3. The formula for determining compound interest is:  A represents the amount to earn; P is the principle that is initially invested; r is the interest rate earned; n is the number of times the interest is compounded; and t is the number of time periods for the investment. Write a program that prompts the user to enter P, r, n and t. The program should output the amount earned on the investment. 4. Look up the Pythagorean theorem if you are not already familiar with it. Use the following formula to solve for c in the formula: c = √a2 + b2. Use the proper functions from the cmath header file. Be sure to output the result.l

Chapter 7 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY