New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
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
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
computer science
java concepts late objects
Java Concepts Late Objects 3rd Edition Cay S. Horstmann - Solutions
Cameras today can correct “red eye” problems caused when the photo flash makes eyes look red. Write pseudocode for an algorithm that can detect red eyes. Your input is a pattern of colors, such as that at right. You are given the number of rows and columns. For any row or column number, you can
Write a program that prints an animal speaking a greeting, similar to (but different from) the following: ('') / Hello \ (-)< Junior | \ Coder!/ I||
How do you discover syntax errors? How do you discover logic errors?
A television manufacturer advertises that a television set has a certain size, measured diagonally. You wonder how the set will fit into your living room. Write an algorithm that yields the horizontal and vertical size of the television. Your inputs are the diagonal size and the aspect ratio (the
Write a program that prints a house that looks exactly like the following: + + + +-- 1||| +ー+-キ=+
Write three versions of the HelloPrinter.java program that have different compile time errors. Write a version that has a run-time error.
Suppose you received a loyalty promotion that lets you purchase one item, valued up to $100, from an online catalog. You want to make the best of the offer. You have a list of all items for sale, some of which are less than $100, some more. Write an algorithm to produce the item that is closest to
Write a program that prints an imitation of a Piet Mondrian painting. (Search the Internet if you are not familiar with his paintings.) Use character sequences such as @@@ or ::: to indicate different colors, and use - and | to form lines.
What is the compile-time error in this program?public class Test{public static void main(String[] args){System.out.println("Hello", "World!");}}
Consider a robot that has been placed in a maze. The right-hand rule tells you how to escape from a maze: Always have the right hand next to a wall, and eventually you will find an exit. The robot can:• Move forward by one unit.• Turn left or right.• Sense what is in front of it: a wall, an
Write a program that prints a face similar to (but different from) the following: (| 00 |)
What does this program print? Pay close attention to spaces.public class Test{public static void main(String[] args){System.out.print("Hello");System.out.println("World");}}
Consider a robot that is placed in a room. The robot can:• Move forward by one unit.• Turn left or right.• Sense what is in front of it: a wall, a window, or neither.Write an algorithm that enables the robot, placed anywhere in the room, to count the number of windows. For example, in the
Write a program that prints your name in Morse code, like this:.... .- .-. .-. -.--Use a separate call to System.out.print for each letter.
What does this program print?public class Test{public static void main(String[] args){System.out.println("39 + 3");System.out.println(39 + 3);}}
Write an algorithm that allows a robot to mow a rectangular lawn, provided it has been placed in a corner, like this: The robot (marked as R) can:• Move forward by one unit.• Turn left or right.• Sense the color of the ground one unit in front of it.
Write a program that prints your name in large letters, such as ** **** **** **** **** ******
On your own computer or on a lab computer, find the exact location (folder or directory name) ofa. The sample file HelloPrinter.java, which you wrote with the editor.b. The Java program launcher java.exe or java.c. The library file rt.jar that contains the run-time library.
Write an algorithm to create a tile pattern composed of black and white tiles, with a fringe of black tiles all around and two or three black tiles in the center, equally spaced from the boundary. The inputs to your algorithm are the total number of rows and columns in the pattern.
Write a program that displays your name inside a box on the screen, like this: Dave Do your best to approximate lines with characters such as | - +.
Explain two benefits of using Java over machine code.
Imagine that you and a number of friends go to a luxury restaurant, and when you ask for the bill you want to split the amount and the tip (15 percent) between all. Write pseudocode for calculating the amount of money that everyone has to pay. Your program should print the amount of the bill, the
Write a program that prints the balance of an account after the first, second, and third year. The account has an initial balance of $1,000 and earns 5 percent interest per year.
A toaster is a single-function device, but a computer can be programmed to carry out different tasks. Is your cell phone a single-function device, or is it a programmable computer?
The value of π can be computed according to the following formula:Write an algorithm to compute π. Because the formula is an infinite series and an algorithm must stop after a finite number of steps, you should stop when you have the result determined to six significant digits. 1 1 1 1 35 79
Write a program that prints the product of the first ten positive integers, 1 × 2 × … × 10. (Use * to indicate multiplication in Java.)
Which parts of a computer serve to give information to the user? Which parts take user input?
You want to find out which fraction of your car’s use is for commuting to work, and which is for personal use. You know the one-way distance from your home to work. For a particular period, you recorded the beginning and ending mileage on the odometer and the number of work days. Write an
Write a program that prints the sum of the first ten positive integers, 1 + 2 + … + 10.
Which parts of a computer can store program code? Which can store user data?
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to your place of work, and the fuel efficiency of your car (in miles per gallon). You also know the one-way price of a train ticket. You assume the cost of gas at $4 per
Write a program that prints a greeting of your choice, perhaps in a language other than English.
Explain the difference between using a computer program and programming a computer.
In the United States there is no federal sales tax, so every state may impose its own sales taxes. Look on the Internet for the sales tax charged in five U.S. states, then write a program that prints the tax rate for five states of your choice. Sales Tax Rates Alaska: Hawaii: 0% 4%
Write a program that prints a two-column list of your friends’ birthdays. In the first column, print the names of your best friends; in the second, print their birthdays.
Showing 800 - 900
of 835
1
2
3
4
5
6
7
8
9
Step by Step Answers