Write a program that converts date formats

Assignment Help JAVA Programming
Reference no: EM13339998

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: EM13339998

Questions Cloud

Draw a graph to illustrate the shape of a typical indifferen : The consumer has an income of $24 per week. The price of a hamburger is $2 and the price of a milkshake is $1. How many milkshakes and hamburgers will he buy each week if he maximizes utility? Illustrate your answer on a graph.
Identify the competitive advantages of some market leaders : Identify the competitive advantages of some market leaders such as Sony. Are these country-specific or firm-specific advantages?Answer the above in 300-350 word essay format with at least two cited references as per APA 6th Ed. format.
What is the magnitude of the average current in the region : Suppose that a particle accelerator is used to move two beams of particles in opposite directions. In a particular region, electrons move to the right at 9350 m/s and protons move to the left at 1.230 × 103 m/s.
Calculate how long is the plane : A 3.9- cm-radius ball rolls down an inclined plane from rest at the top. How long is the plane
Write a program that converts date formats : 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..
Find the gauge pressure in the pipe on the top floor : Water at a gauge pressure of P = 3.4 atm at street level flows into an office building at a speed of 0.90m/s through a pipe 5.6 cm in diameter. find the gauge pressure in the pipe on the top floor
What would be the effect of this investment on u.s. gdp : What would be the effect of this investment on U.S. GDP? Would the effect on U.S. GNP be larger or smaller?
What is a business model : What is a business model? How does it differ from a business plan?
Estimate the fixed cost and variable cost : Using least-squares regression, estimate the fixed cost and variable cost elements of monthly car wash costs.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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