Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 5, Problem 5PE
Program Plan Intro
Program to calculate numeric value of a name
Program plan
- Define class main. Inside the main function
- Declare variable lookup
- Define variable inputname
- Define variable formatinputname
- Execute for loop
- Define variable wordvalue
- Define variable letter
- Define variable lettervalue
- Define variable wordvalue
- Print the statement
- Call the main function
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a fish is swimming past if:there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call "Fish Rising"), orthere are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call "Fish Diving"), orthere are four consecutive depth readings which are identical (which we will call "Constant Depth").All other readings will be considered random noise or debris, which we will call "No Fish."Create a Python program called "fishfinder_firstname_lastname" that takes 1 input of string of 4 numbers separated with comma. Your program must display "Fish Rising", "Fish Diving.", "Fish At Constant Depth" or "No Fish".Example:30,10,20,20 Must display No…
What is the English language denoted by the following Regular Expression R= (k|b)*(k|bb).
Computer Science
The term “knowledge” is defined in the dictionary (Oxford Learner’s Dictionaries) as the information, understanding, and skills that a person gains through education or experience. So, it is expected that only human-beings can possess and use knowledge.
However, with machine learning and deep learning, it now seems that “machine” can also possess and use knowledge. For example, Google’s AlphaGO won three-match series against the world’s best Go players.
Can “machine” possess and use knowledge? What do you think? Please provide details and examples to support your opinions.
Chapter 5 Solutions
Python Programming: An Introduction to Computer Science, 3rd Ed.
Ch. 5 - Prob. 1TFCh. 5 - Prob. 2TFCh. 5 - Prob. 3TFCh. 5 - Prob. 4TFCh. 5 - Prob. 5TFCh. 5 - Prob. 6TFCh. 5 - Prob. 7TFCh. 5 - Prob. 8TFCh. 5 - Prob. 9TFCh. 5 - Prob. 10TF
Ch. 5 - Prob. 1MCCh. 5 - Prob. 2MCCh. 5 - Prob. 3MCCh. 5 - Prob. 4MCCh. 5 - Prob. 5MCCh. 5 - Prob. 6MCCh. 5 - Prob. 7MCCh. 5 - Prob. 8MCCh. 5 - Prob. 9MCCh. 5 - Prob. 10MCCh. 5 - Prob. 1DCh. 5 - Prob. 2DCh. 5 - Prob. 3DCh. 5 - Prob. 4DCh. 5 - Prob. 5DCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 11PECh. 5 - Prob. 12PECh. 5 - Prob. 13PECh. 5 - Prob. 14PECh. 5 - Prob. 15PECh. 5 - Prob. 16PE
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
- Discrete Mathematics: Assignment details: Replace all the 0 (Zero) digits in your ID by 4. Example: If your ID is 38104680, it becomes 38144684 Take the first 6 digits and substitute them in this expression (( A + B) / C) * ((D-E)/F)-2) according to the following table; Letter Replace by Digit Example Digit A 1st 3 B 2nd 8 C 3rd 1 D 4th 4 E 5th 4 F 6th 6 After substitution your expression will be similar to this (( 3 + 8) / 1) * ((4-4)/6)-2). Draw a rooted tree that represents your expression. What is the prefix form of this expression. 3.What is the value of the prefix expression obtained in step 2 above?arrow_forwardBlue-Eyed Island: A group of individuals live on an island until a visitor arrives with an unusual order: all blue-eyed people must leave the island as quickly as possible. Every evening at 8:00 p.m., a flight will depart. Everyone can see everyone else's eye colour, but no one knows their own (nor is anyone allowed to tell them). Furthermore, they have no idea how many people have blue eyes, but they do know that at least one person does. How long will it take for the blue-eyed individuals to leave?arrow_forwardSkydiving Bibi is a skydiving instructor. Before carrying out skydiving activities, Bibi will always ask the name, height, and age of the participants. Bibi's participants is always 2 people. To make it easier to remember their identities, Bibi gave them a paper to write down their identity. But because they are very enthusiastic in doing skydiving, they write their identity in a single line only (for both of the participants), so it wasn't quite neat and it made difficult for Bibi to see it, and resulted in the skydiving process being disturbed. As one of the organizer committee, you do not want this activity to be disturbed and plan to provide a program that provides their identity neatly to Bibi. Format Input Input consists of 1 line. It contains the identity of 2 people in a row Ni, Ti, Ui - the name, height, and age of the i-th participant. Format Output The output consists of 6 lines. The first line, "Name 1: N1". The second line, "Height 1: T1". The third line, "Age: U1". For…arrow_forward
- Factorial of a number is defined as: n! = n(n-1)(n-2)(n-3)...(2)(1) For example, 4! = 4*3*2*1 The n! can be written in terms of (n-1)! as: n! = n* (n-1)! (n-1)! = (n-1)*(n-2) ! and so forth. Thus, in order to compute n!, we need (n-1)!, to have (n-1)!, we need (n-2)! and so forth. As you may immediately notice, the base case for factorial is 1 because 1! = 1. Write a program that uses a recursive function called factorial that takes an integer n as its argument and returns n! to the main. C++ PLEASEarrow_forwardShips of the navy of communicate at sea via code signals transmitted by flags, as follows: each ship has six flags (the same set of six flags is on every ship); a code is formed by choosing three flags and arranging them, from top to bottom, on the mainmast. How many different codes are possible? Example: "don't pull that big plug in the bottom of the boat" differs from "if you sail too close to the edge, you'll fall off"arrow_forwardThe International Standard Book Number (ISBN) is a number that uniquely identifies a book. Publishers can buy or receive ISBNs from the International ISBN Agency. There are two types of ISBNs: ISBN-13 and ISBN-10, which are 10- and 13-digits long, respectively.ISBN-10 has a pattern, where the last digit can be found using the first 9. Additionally, ISBN-10 can also be used to calculate its ISBN-13 equivalent (and vice versa). Write two functions in ISBN.java. The main method is implemented for you so you can test your functions. Instructions on how to run this file to make use of the test.txt file are detailed below. calculateISBN10(int[] isbn) computes the last digit of the ISBN-10 number. The first 9 of the 10 digits of the ISBN will be passed to the function as the parameter isbn integer array of size 10. The last integer in the array will be -1. Your job is to calculate the last digit (called the check digit), and update the last index of the isbn array with the computed…arrow_forward
- The International Standard Book Number (ISBN) is a number that uniquely identifies a book. Publishers can buy or receive ISBNs from the International ISBN Agency. There are two types of ISBNs: ISBN-13 and ISBN-10, which are 10- and 13-digits long, respectively.ISBN-10 has a pattern, where the last digit can be found using the first 9. Additionally, ISBN-10 can also be used to calculate its ISBN-13 equivalent (and vice versa). Write two functions in ISBN.java. The main method is implemented for you so you can test your functions. Instructions on how to run this file to make use of the test.txt file are detailed below. calculateISBN10(int[] isbn) computes the last digit of the ISBN-10 number. The first 9 of the 10 digits of the ISBN will be passed to the function as the parameter isbn integer array of size 10. The last integer in the array will be -1. Your job is to calculate the last digit (called the check digit), and update the last index of the isbn array with the computed…arrow_forwardprogramming for business field in python write a program to find the depreciation value of an asset (property) by reading the purchase value of the asset (amt), year of the service (year) and the value of the depreciationarrow_forwardModified True or False Multicollinearity can also result from the repetition of the same kind of variable.arrow_forward
- In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because 12 + 3? = 10 and 1² + o² = 1. On the other hand, 4 is not a happy number because the sequence starting with 4 = 16 and 12 + 62² = 37 and eventually reaches to 4 that is the number that started the sequence, and so the process continues in an infinite cycle without ever reaching 1. Write, Compile and Execute a Java method that computes whether a given number is happy or sad.arrow_forwardComputer Progarrow_forwardIN C PROGRAMMING LANGUAGE A resistor is a circuit device designed to have a specific resistance value between its ends. Resistance values are expressed in ohms (Ω) or kilo-ohms (kΩ). Resistors are frequently marked with colored bands that encode their resistance values, as shown in the Figure. The first two bands are digits, and the third is a power-of-ten multiplier. The Table below shows the meanings of each band color. For example, if the first band is green, the second is black, and the third is orange, the resistor has a value of 50 × 103 Ω or 50 k Ω. The information in the Table can be stored in a C program as an array of strings. char COLOR_CODES[10][7] = {"black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "gray", "white"}; Notice that “red” is COLOR_CODES[2] and has a digit value of 2 and a multiplier value of 102. In general, COLOR_CODES[n] has digit value n and multiplier value 10n. Write a program that prompts for the colors…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License