All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
starting out with programming logic and design
Questions and Answers of
Starting Out With Programming Logic And Design
Recall that Programming Exercise 3 in Chapter 8 asked you to design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display
Recall that Programming Exercise 5 in Chapter 8 asked you to design a program that asks the user to enter a charge account number. The program should determine whether the number is valid by
Recall that Programming Exercise 7 in Chapter 8 asked you to design a program with two parallel arrays: a String array named people and a String array named phone Numbers. The program allows you to
Look at the following pseudocode class definitions:Given these class definitions, what will the following pseudocode display? Class Plant Public Module message () Display "I'm a plant. End Module End
Design a class named Pet, which should have the following fields:Once you have designed the class, design a program that creates an object of the class and prompts the user to enter the name, type,
Design a class named Car that has the following fields:Next, design a program that creates a Car object, and then calls the accelerate method five times. After each call to the accelerate method, get
Design an Essay class that extends the GradedActivity class presented in this chapter. The Essay class should determine the grade a student receives for an essay. The student’s essay score can be
What is an event-driven program?
Design an event handler that will execute when the calcAvailableCreditButton component is clicked. The event handler should perform the following: Declare the following Real variables: maxCredit,
Sometimes it is helpful to update another person with your current location via a text message.Design a mobile app that does the following:Note that the user should not have to enter a phone number
Assume a program has the following declarations:Write pseudocode with a set of nested loops that stores the value 99 in each element of the info array. Constant Integer ROWS = 100 Constant Integer
Look at the following pseudocode:a. What value is stored in numbers[2]?b. What value is stored in numbers[0]? Constant Integer SIZE === 3 Declare Integer numbers [SIZE] = 1, 2, 3
Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the
Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop that steps through the array, randomly generating a number in the
Design a program that asks the user to enter a charge account number. The program should determine whether the number is valid by comparing it to the following list of valid charge account
Design a program that displays the number of days in each month. The program’s output should be similar to this:The program should have two parallel arrays: a 12-element String array that is
Design a program that has two parallel arrays: a String array named people that is initialized with the names of seven of your friends, and a String array named phoneNumbers that is initialized with
Design a program that uses the following parallel arrays:empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers:The
Design a program that has a two-dimensional integer array with 7 rows and 7 columns. The program should store a random number in each element. Then, the program should search the array for saddle
Design a program that allows two players to play a game of tic-tac-toe. Use a two-dimensional String array with three rows and three columns as the game board. Each element of the array should be
Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in ascending order and display its contents.
Design a program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents.
Design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values. The module should keep a count of the
What is a file’s read position? Initially, where is the read position when an input file is opened?
Brewster’s Used Cars, Inc. employs several salespeople. Brewster, the owner of the company, has provided a file that contains sales records for each salesperson for the past month. Each record in
Assume that you have a file that contains the weekly average prices for a gallon of gas in the United States for the past 3 years. The data is stored in the file as records. Each record contains the
What is a menu-driven program?
What is a single-level menu?
What is a multiple-level menu?
Design a program that displays the following menu: If the user selects item 1, the program should display “Good morning.” If the user selects item 2, the program should display “Buongiorno.”
University Meal Plan Selector The university offers the following meal plans:Plan 1: 7 meals per week for \($560\) per semester Plan 2: 14 meals per week for \($1\),095 per semester Plan 3: Unlimited
Write a program that displays the following menu:If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula to calculate the
Create an application that displays the following menu: When the user selects a planet from the menu, the program should display data about the planet’s average distance from the sun, the
In Programming Exercise 6 in Chapter 10 you designed the following two programs for the Springfork Amateur Golf Club:Consolidate these programs into a single program that presents a menu, allowing
Design a program that you can use to keep all of your friends’ names and phone numbers in a file. The program should be menu-driven, and offer the following operations: 1. Add a new record 2.
The following table shows the approximate speed of sound in air, water, and steel.Design a program that displays a menu allowing the user to select air, water, or steel. After the user has made a
Design a program that prompts the user to enter a string and then displays the string contents backward. For instance, if the user enters “gravity” the program should display “ytivarg.”
Design a program that prompts the user to enter a string containing multiple sentences, and then displays the string with the first character of each sentence capitalized. For instance, if the user
Design a program that prompts the user to enter a string. The program should then display the number of vowels and the number of consonants in the string.
Design a program that prompts the user to enter a string, and displays the character that appears most frequently in the string.
File encryption is the science of writing the contents of a file in a secret code. For this assignment you will design a program that opens a file and encrypts its contents. Assume the file that you
Password Weakness Detector Design a program that asks the user to enter a password, and then analyzes the password for the following weaknesses: Fewer than 8 characters Does not contain at least one
Design a function that accepts an array and the array’s size as arguments, and returns the largest value in the array. The method should use recursion to find the largest element.
Design a function that accepts an Integer array and the size of the array as arguments. The function should recursively calculate the sum of all the numbers in the array and return that value.
Design a function that accepts an integer argument and returns the sum of all the integers from 1 up to the number passed as an argument. For example, if 50 is passed as an argument, the function
Design a function that uses recursion to raise a number to a power. The function should accept two arguments: the number to be raised and the exponent. Assume that the exponent is a nonnegative
Ackermann’s Function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Design a function ackermann (m, n), which solves Ackermann’s Function.
What is a default constructor?
What is a problem domain description?
Look at the following pseudocode class definitions:Given these class definitions, what will the following pseudocode display? Class Vegetable Public Module message () Display "I'm a vegetable." End
This exercise assumes you have already designed the is Prime function in Programming Exercise 10. Design another program that displays all of the prime numbers from 1 through 100. The program should
The term empty input describes what happens when a. the user presses the Spacebar Enter and then the key b. an input operation attempts to read data, but there is no data to read c. the user enters 0
A dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost \($20\) each, section B seats cost \($15\) each, and section C
Programming Exercise 11 in Chapter 6 asked you to design a program that plays the Rock, Paper, Scissors game. In the program, the user enters one of the three strings—"rock", "paper", or
What is an off-by-one error?
The area of a rectangle is calculated according to the following formula:Design a function that accepts a rectangle’s width and length as arguments and returns the rectangle’s area. Use the
Design a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as:The program should allow the student to enter the answer. If the answer is
A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images
Design a number guessing game program. The program should generate a random number and then ask the user to guess the number. Each time the user enters his or her guess, the program should indicate
What is a program?
What is hardware?
List the five major components of a computer system.
What encoding scheme is extensive to represent all the characters of all the languages in the world?
In a(n)________ numbering system, all numeric values are written as sequences of 0s and 1s.a. hexadecimalb. binaryc. octald. decimal
In the________ part of the fetch-decode-execute cycle, the CPU determines which operation it should perform.a. fetchb. decodec. executed. immediately after the instruction is executed
Computers can only execute programs that are written in ________.a. Javab. assembly languagec. machine languaged. C++
The rules that must be followed when writing a program are called ________.a. syntaxb. punctuationc. key wordsd. operators
What are the words that make up a high-level programming language called?
Look at the ASCII chart in Appendix A and determine the codes for each letter of your first name.
What is pseudocode?
Look at the following pseudocode statement:What happens when this statement executes? Input temperature
Who is the user?
What is a prompt?
What two steps usually take place when a program prompts the user for input?
A(n)________ sets a variable to a specified value.a. variable declarationb. assignment statementc. math expressiond. string literal
True or False In most languages, the first character of a variable name cannot be a number.
What does the term user-friendly mean?
One acre of land is equivalent to 43,560 square feet. Design a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. Divide the
A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the
Assuming there are no accidents or delays, the distance that a car travels down the interstate can be calculated with the following formula:A car is traveling at a constant 60 miles per hour. Design
Design a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent
If a moderately active person cuts their calorie intake by 500 calories a day, he or she can typically lose about 4 pounds a month. Write a program that has the user enter their starting weight and
A person pays a fixed amount each month as a car payment. Design a program that asks the user to enter the amount he or she pays each month, and the number of months he or she has been making
You’re planning a pizza party and you plan to give each person 3 slices of pizza. Design a program that displays the number of slices that will be leftover. The program should ask for the following
Design a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows:The program should ask the user to enter a temperature in Celsius, and then display the
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a serving equals 300 calories. Design a program that lets the user enter
Design a program that asks the user for the number of males and the number of females registered in a class. The program should display the percentage of males and females in the class. Suppose there
A cookie recipe calls for the following ingredients:The recipe produces 48 cookies with these amounts of the ingredients. Design a program that asks the user how many cookies he or she wants to make,
Programming Exercise 6 in Chapter 2 was the Sales Tax program. For that exercise you were asked to design a program that calculates and displays the county and state sales tax on a purchase. If you
Design a modular program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight
There are three seating categories at a stadium. For a softball game, Class A seats cost \($15\), Class B seats cost \($12\), and Class C seats cost \($9\). Design a modular program that asks how
A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $20.00 per hour for labor. Design a
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the
The symbols >,
Design a program that prompts the user to enter a number within the range of 1 through
The program should display the Roman numeral version of that number. If the number is outside the range of 1 through 10, the program should display an error message. VideoNote The Areas of Rectangles
The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown here:Design a
Design a program that asks the user to enter a number of seconds, and works as follows: There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60,
What is a condition-controlled loop?
What is a count-controlled loop?
Showing 1 - 100
of 584
1
2
3
4
5
6