Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
4th Edition
ISBN: 9780134787961
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2, Problem 1SA
Is the following comment a single-line style comment or a multi-line style comment?
/* This
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Open with Google Docs
ENG-101
Intro Computing Engineers Homework 4
Question 16
Scissors. :
sints) Write well-documented Python program to play Rock, Paper,
Sheldon Cooper, the fictional character on the CBS TV show "The Big Bang Theory", has extended the game Rock
Papers Scissors as described below. Write a well-documented Python program entitled, rockPaper.py, to implement
the game accepting a user input. The main program should allow for lower/upper case user entries. Additionally, the
main program should display the number of times the user won the game during a playing session.
Its Simple
spock smashes scison
scissors cuts paper
scissors
Gecapitates
rand
paper diaproves spock
spock
vaporizes
Ock
crushes
soissors
ard poisons spock
paper covers rock
Seand
eats
paper
rock crushes d
Page
Q +
2
hp
PLEASE CODE IN PYTHON
Problem Description
An anagram is a word or a phrase formed by rearranging the letters of another phrase such as “ITEM” and “TIME”. Anagrams may be several words long such as “CS AT WATERLOO” and “COOL AS WET ART”. Note that two phrases may be anagrams of each other even if each phrase has a different number of words (as in the previous example). Write a program to determine if two phrases are anagrams of each other.
Input Specifications
The input for the program will come from an input file in.dat, in.dat will have two lines of data, line (1) will have the first phrase and the line(2) will have the second phrase. You may assume that the input only contains upper case letters and spaces.
Output Specifications
The program will print out one of two statements: ”Is an anagram.” or, ”Is not an anagram.” All output will be to the screen.
Sample Input
CS AT WATERLOO
COOL AS WET ART
Output for Sample Input
Is an anagram.
Subject: Python Programming
Chapter 2 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Ch. 2.1 - Prob. 2.1CPCh. 2.1 - When the program in Question 2.1 is saved to a...Ch. 2.1 - Complete the following program skeleton so it...Ch. 2.1 - On paper, write a program that will display your...Ch. 2.1 - Prob. 2.5CPCh. 2.1 - Every Java application program must have...Ch. 2.2 - The following program will not compile because the...Ch. 2.2 - Study the following program and show what it will...Ch. 2.2 - On paper, write a program that will display your...Ch. 2.3 - Examine the following program. // This program...
Ch. 2.3 - What will the following program display on the...Ch. 2.4 - Which of the following are illegal variable names...Ch. 2.4 - Prob. 2.13CPCh. 2.4 - Prob. 2.14CPCh. 2.4 - Prob. 2.15CPCh. 2.4 - A program declares a float variable named number,...Ch. 2.4 - Prob. 2.17CPCh. 2.4 - Prob. 2.18CPCh. 2.4 - Prob. 2.19CPCh. 2.4 - Prob. 2.20CPCh. 2.4 - What is wrong with the following statement? char...Ch. 2.5 - Prob. 2.22CPCh. 2.5 - Prob. 2.23CPCh. 2.6 - Write statements using combined assignment...Ch. 2.7 - The following declaration appears in a program:...Ch. 2.7 - The variable a is a float and the variable b is a...Ch. 2.9 - Write a statement that declares a String variable...Ch. 2.9 - Assume that stringLength is an int variable. Write...Ch. 2.9 - Prob. 2.29CPCh. 2.9 - Prob. 2.30CPCh. 2.9 - Prob. 2.31CPCh. 2.11 - Prob. 2.32CPCh. 2.11 - How are documentation comments different from...Ch. 2.14 - Prob. 2.34CPCh. 2.14 - Write code that will display each of the dialog...Ch. 2.14 - Write code that displays an input dialog asking...Ch. 2.14 - Prob. 2.37CPCh. 2 - Every complete statement ends with a __________....Ch. 2 - The following data 72 'A' Hello World 2.8712 are...Ch. 2 - A group of statements, such as the contents of a...Ch. 2 - Which of the following are not valid assignment...Ch. 2 - Which of the following are nor valid println...Ch. 2 - The negation operator is __________. a. unary b....Ch. 2 - This key word is used to declare a named constant....Ch. 2 - These characters mark the beginning of a...Ch. 2 - These characters mark the beginning of a...Ch. 2 - These characters mark the beginning of a...Ch. 2 - Which Scanner class method would you use to read a...Ch. 2 - Which Scanner class method would you use to read a...Ch. 2 - You can use this class to display dialog boxes. a....Ch. 2 - Prob. 14MCCh. 2 - Prob. 15MCCh. 2 - True or False: A left brace in a Java program is...Ch. 2 - True or False: A variable must be declared before...Ch. 2 - True or False: Variable names may begin with a...Ch. 2 - True or False: You cannot change the value of a...Ch. 2 - True or False: Comments that begin with / / can be...Ch. 2 - True or False: If one of an operators operands is...Ch. 2 - What will the following code segments print on the...Ch. 2 - int x = 0, y=2; x = y 4; System.out.println(x +...Ch. 2 - System.out.print(I am the incredible);...Ch. 2 - System.out.print(Be careful\n);...Ch. 2 - int a, x = 23; a = x % 2; System.out.println(x +...Ch. 2 - Find the Error There are a number of syntax errors...Ch. 2 - Show how the double variables temp, weight, and...Ch. 2 - Prob. 2AWCh. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Prob. 5AWCh. 2 - Modify the following program so it prints two...Ch. 2 - What will the following code output? int apples =...Ch. 2 - What will the following code output? double d =...Ch. 2 - What will the following code output? String...Ch. 2 - What will the following code output? String...Ch. 2 - Convert the following pseudocode to Java code. Be...Ch. 2 - Prob. 12AWCh. 2 - Write the code to set up all the necessary objects...Ch. 2 - Prob. 14AWCh. 2 - A program has a float variable named total and a...Ch. 2 - Is the following comment a single-line style...Ch. 2 - Is the following comment a single-line style...Ch. 2 - Describe what the phrase self-documenting program...Ch. 2 - Prob. 4SACh. 2 - Prob. 5SACh. 2 - Prob. 6SACh. 2 - Prob. 7SACh. 2 - Prob. 8SACh. 2 - Briefly describe the difference between variable...Ch. 2 - What is the difference between comments that start...Ch. 2 - Briefly describe what programming style means. Why...Ch. 2 - Assume that a program uses the named constant PI...Ch. 2 - Assume the file Sales Average, java is a Java...Ch. 2 - Prob. 14SACh. 2 - Name, Age, and Annual Income Write a program that...Ch. 2 - Name and Initials Write a program that has the...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Star Pattern Write a program that displays the...Ch. 2 - Sales Prediction The East Coast sales division of...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Cookie Calories A bag of cookies holds 40 cookies....Ch. 2 - Miles-per-Gallon A cars miles-per-gallon (MPG) can...Ch. 2 - Test Average Write a program that asks the user to...Ch. 2 - Circuit Board Profit An electronics company sells...Ch. 2 - Prob. 12PCCh. 2 - Restaurant Bill Write a program that computes the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Commission Kathryn bought 600 shares of...Ch. 2 - Energy Drink Consumption A soft drink company...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Word Game Write a program that plays a word game...Ch. 2 - Stock Transaction Program Last month Joe purchased...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Briefly describe what each of the following statements does: file.seekp(100L, ios::beg); file.seekp(10L, ios::e...
Starting Out with C++ from Control Structures to Objects (9th Edition)
In SQL, what statement do you use to retrieve specific rows from a table in a database?
Starting out with Visual C# (4th Edition)
We know that the first file name is stored at index zero in the ArrayList, and the list stores the file names a...
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Contrast the following terms: chief data officer; DBA data administration: database administration open source ...
Modern Database Management (12th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
A file that contains a Flash animation uses the __________ file extension. a. .class b. .swf c. .mp3 d. .flash
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
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
- Python Project: Problem #1: How much should I study outside of class?Issue:Your fellow students liked the previous version of study hour’s application andwant to expand it again by adding the features listed below.Minimum Study Hours per Week per Class Grade15 A12 B9 C6 D0 FProject Specifications:1. The program asks the user their name, employee id, and department.2. The program also asks the user who they are creating the report for, their employeeid, and the department they work in. (hint #1 & 2 are instances of a class – A classmust be created and used within the program)3. The menu driven program has the following options:A. Determine Hours to StudyB. Determine GradeC. Display Averages and TotalsD. QuitThe user can select any menu option in any order they want.For example:o The user can start the program run option A, then option C, then option B,then option D.o They restart the program, run option C, then D.o They restart the program, run option A, then D.o They restart the…arrow_forwardPlease review the image below. Produce the program in C++. Upload screenshots of Code and Output, as well as the source code. 4arrow_forwardPython programming only FIX THE ERRORS IN THE CODE EXERCISE Here is a program on calculating grades. Please correct the errors in the program.# Calculating Grades (ok, let me think about this one)# Write a program that will average 3 numeric exam grades, return an average test score, a corresponding letter grade, and a message stating whether the student is passing. # Average Grade# 90+ A# 80-89 B# 70-79 C# 60-69 D# 0-59 F# Exams: 89, 90, 90# Average: 90# Grade: A# Student is passing.# Exams: 50, 51, 0# Average: 33# Grade: F# Student is failing.exam_one = int(input("Input exam grade one: "))exam_two = input("Input exam grade two: "))exam_3 = str(input("Input exam grade three: "))grades = [exam_one exam_two exam_three]sum = 0for grade in grade: sum = sum + gradeavg = sum / len(grdes)if avg >= 90: letter_grade = "A"elif avg >= 80 and avg < 90 letter_grade = "B"elif avg > 69 and avg < 80: letter_grade = "C'elif avg <= 69 and avg >= 65: letter_grade = "D"elif:…arrow_forward
- Concerning python The ___ statement allows the programmer access to functions not readily available in python directly. a. import b. module c. def d. randomarrow_forward1 # Calculator.py - This program performs arithmetic, ( +. -, *. / ) on two numb 2 # Input: Interactive Summary 3 # Output: Result of arithmetic operation 4 In this lab, you complete a partially written Python program that includes a function that returns a 5 # Write performOperation function here value. The program is a simple calculator that prompts the user for two numbers and an operator ( +, -, *, or / ). 7 if -_name_- == '-_main__': numberOne = int(input("Enter the first number: ")) numberTwo = int(input("Enter the second number: ")) operation = input("Enter an operator (+ - * /): ") 8 The two numbers and the operator are passed to the function where the appropriate arithmetic 10 operation is performed. The result is then returned to where the arithmetic operation and result are 11 displayed. 12 # Call performOperation method here and store the value in "result" 13 For example, if the user enters 3, 4, and *, the following is displayed: 14 print(str(numberOne) + " " + operation +…arrow_forwardC++arrow_forward
- Python please: Complete the program to read the needed values from input that the existing output statement can use to generate information for an "Introduce Yourself" page of a class website. You need the following input: First name Last name Job title A programming language A short sentence about yourself For example, if the input is Mark Zee CEO C++ And I own Facebook. then the output is Mark's Short Bio My Name is Mark Zee. I am a CEO and I want to learn C++ to make myself proficient at programming. And I own Facebook.arrow_forwardCreate a program in Python that asks the user to enter: - The names of 5 students and their corresponding quiz scores - The total of the quizzes will be calculated - The average of the quizzes will be calculated - Print a report of the quizzes which consists of output statements to print: - A comumn heading report (centered) - Student name and quiz column heading - All 5 of the student names and corresponding quizzes in two columns as shown on the next page: - The total of all the quizzes - An average of all the quizzesarrow_forward# # program11.py # COP 1000 Professor Cutler # # This program prints the answers to the questions # # PSEUDOCODE # # Print full name and section number of COP 1000 # Print the name of the function that converts a string to a floating point number # Print the symbol used to start a Python comment # Print the name of Python data type for numbers without decimals # Print the purpose of the \t escape character # Print answer to question 1 print("My name is Luis Faz COP 1000 Computer Programming") # Print answer to question 2 print("The float() function can convert strings to a float") # Print answer to question 3 print("The symbol used to start a comment in Python is the pound symbol \'#\' ") # Print answer to question 4 print("The Python data type used for numbers is the integer type, whole numbers only") # Print answer to question 5 print ('The backslash-t escape character is used to insert TAB spaces into outputs\tlike\tthis')arrow_forward
- Python*** General Foo’s Last Chance Gas station sits on route 190 on the edge of Death Valley. There is no other gas station for 200 miles. You are to write a Python program to help drivers if they need gas. The program asks for user input:• Vehicle Name, any name is valid (e.g. Toyota, Mercedes, Ford, GM, Chrysler, Nissan, Kia, Honda, etc.)• Vehicle Type: valid types are C: Car , S: SUV or T: Truck (note lower case letters are also allowed, e.g. c, s, or t; all others are invalid). If a user enters incorrect type, a message to that effect should be printed and no other information printed• The capacity of the gas tank, in gallons• The indication of the gas gauge in percent (full=100, three-quarters full=75, and so on, empty=0) Assume that a car’s gas mileage is 32 miles per gallon, a SUV’s gas mileage is 25 miles per gallon and a truck’s mileage is 15 miles per gallon. Depending upon user input, your program prints a message to either put a minimum amount of gas in the vehicle or…arrow_forward11. Which of the following elements of a mathematical expression in python is evaluated first? a. Subtraction b. Multiplication c. Parenthesis d. Addition e. 12. What is the value of the following expression? 42 % 10 a. 4210 b. 10 c. 420 d. 2 е.arrow_forwardc++ pleasearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY