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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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