Prompts the user to input an integer between 0 and 35

Assignment Help Basic Computer Science
Reference no: EM13998075

Problem 1.1

Write a program that prompts the user to input the length and breadth of a rectangle and then print the rectangle's area?
Problem 1.2 (Programming Exercises (Chapter 3, Exercise 3 pp-165))

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets-box, sideline, premium, and general admission. After each game, the data is stored in a file in the following form:
ticketPrice numberOfTicketSold
.......
Sample data are shown below:
250 5750
100 28000
50 35750
25 18750

The first line indicates that the box ticket price is $250 and 5750 tickets were sold at that price. Please type above information into a text file and write a program to read those data and output the number of tickets sold and the total sale amount on the screen.

Problem 1.3

Write a program that converts date formats from American Format: "September 4, 2013" to International Format; - such as "2013-September-4".

Hint: you may use several string methods, including:
str.indexOf(c): given a string str and a character c, this finds the position (starting at 0) of the first instance of c in str.
str.substring(p): given a string str and a position p, this method returns a new string starting at position p and going until the end of the string.

You can solve this problem in the follow way. You should first look for everything that comes before the first space. This will be the month. Save this in a String variable, and then use substring to find everything that comes after this point -the remainder of the string. Working from this remainder, you can search for the comma (using indexOf) to find the piece that has the date. Once you have this, everything after the comma is the year. You can then using string concatenation (with the + operator) to tie the year, month and date together like "2008-January-30".

Problem 1.4

Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12,..., Z for 35. (Hint: use the case operator (char)(number+55)).

Reference no: EM13998075

Questions Cloud

How would harley-davidson''s business be affected : How would Harley-Davidson's business be affected if it decided to sell accessories directly to its online customers? Include a brief discussion of ethics involved with this decision
Search for commercial idps systems : 1.Using the Internet, search for commercial IDPS systems.  What classification systems and descriptions are used, and how can these be used to compare the features and components of each IDPS?  Which IDPS systems do you think are superior in their fe..
Web diagram organizing the following specific technologies : Create a table or web diagram organizing the following specific technologies (as discussed in your textbook) in the order they would appear in an IT network connected to the internet:  Vulnerability scanners Firewalls
Access control systemsaccess control : Access Control SystemsAccess Control Guidelines based on Data Classification Assignment RequirementsAssume you are a security engineer for a corporation. This corporation has developed a classification scheme as follows
Prompts the user to input an integer between 0 and 35 : The first line indicates that the box ticket price is $250 and 5750 tickets were sold at that price. Please type above information into a text file and write a program to read those data and output the number of tickets sold and the total sale amo..
Describe the earned value management terms : Describe issues in project cost estimating and how to deal with each. Describe the earned value management terms
How many bits will be used for the subnet id : We wish to create 8 subnets in a /24 network. Assume that we wish to use the minimum number of bits for the subnet id. A. How many bits will be used for the subnet id?
What is the nature of the litigation was the case an appeal : Outline the specific legal question(s) that was before the court. If the court addressed multiple issues address each separately. Your issues should be concisely stated and specific, mot generalizations.
What distance does the satellite travel in one day : A satellite orbits at a distance from the Earth's center of about 7.40 Earth radii and takes 28.3 hours to go around once. What distance (in meters) does the satellite travel in one day? What is its orbital velocity (in m/s)?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Calculate the matrix determinant value

The matrix coef has exactly four columns and three rows. The function should return a row vector s that contains solution values each of which satisfies the equation below as x, y and z. You are allowed to use det to calculate the matrix determina..

  Provide a brief overview of the organizations

Provide a brief overview of the organizations that have developed and promoted each format.

  Describe the model''s strengths and weaknesses

Describe the model's strengths and weaknesses

  Deliver to match the challenge of the digital age

Discuss how one of these industries has reacted. Has it found ways to reinvent the products and services they deliver to match the challenge of the Digital Age?

  How "direction" can be used in an effective publication?

What are four examples of how "direction" can be used in an effective publication?

  Is security mechanisms and practices

Organizations around the world often assess their IS security mechanisms and practices by using the Trusted Computer System Evaluation Criteria (TCSEC) or Information Technology Security Evaluation Criteria (ITSEC). The two standards are similar, tho..

  Derive algebraic expressions for the optimalleisure

Given the utility function u(c, l) = α log(c) + (1 - α) log(l) and the assumption that the only source of income of the representative consumer is her labor income. In addition, suppose she pays a consumptiontax θ ∈ [0, 1) for every unit of good cons..

  Discussed security protocols from ip layer

We have discussed security protocols from IP layer (e.g., IPSec) to application layer (e.g. XML and S/MIME). Are they redundant? Is it possible to design a universal security solution at one layer? Provide arguments to support your viewpoint.

  Completion time for multiprocessor

1. Show that the greedy algorithm to minimize the mean completion time for multiprocessor job scheduling works. 2. The input is a set of jobs j1, j2, ... , jN, each of which takes one time unit to complete. Each job jiearns di dollars if it is comple..

  What are some presentation-tools options available

What are some presentation-tools options available in the market place? Pick 3 and research them. What are the advantages and disadvantages

  Mobile device security

Suggest three (3) benefits that organizations can gain from deploying a Mobile Device Management (MDM) security solution. Additionally, suppose that an organization chose not to deploy an MDM solution. Determine what you believe to be the major risks..

  Create two constructors

Create two constructors (default and initialization), accessor (get/set) methods, a printInfo method, a toString method, a method deposit that will increase the balance by a specified amount returning nothing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd