Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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)).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91706907
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Search treestry to adopt all four traversal algorithm

Search trees. Try to adopt all four traversal algorithm procedures for any binary tree. Write methods to count the number of nodes in a binary tree to count the number of leaves to count the number of right children to f ...

The project is the process of implementing an information

The project is the process of implementing an information system proposal that provides a specific strategic direction while setting company performance goals and delivering customer value. I need help Identifying 4 diff ...

Question ransomware to pay or not to pay when it comes to

Question: Ransomware: To pay or not to pay? When it comes to corporate data, should corporations pay? Can you trust paying? What can be done to protect against ransomware?Would you pay if it were your own personal data? ...

Create login form to enter user name and a password textbox

Create login form to enter user name and a password textbox to enter password, and write procedure to simulate the process of triggering the login process after hitting the Enter Key.

Task working with arrays in matlabnbspcreate a matlab

Task : Working with Arrays in MatLab  Create a MatLab script called a2taski.m that computes the following tasks. The answers will appear in the Workspace. To view the larger structures, e.g., matrix A in Part 1 double cl ...

Consider a tcp connection between two hosts that are 400

Consider a TCP connection between two hosts that are 400 miles away from each other (propagation delay is 100 miles per msec.). Assume that there is no error or loss in this communication and the receive window size is s ...

Suppose you are doing some online banking using your banks

Suppose you are doing some online banking using your bank's website. An attacker has set up an active wiretap between your computer and your bank's server. After checking your balance and reading through your transaction ...

Search the internet for 5 open source reporting software

Search the internet for 5 open source reporting software packages of your choice? Explain why you think these software packages are the best for BI/DSS Reporting? Choose one of them and do associated with the reporting s ...

Birth weights of full-term babies in a certain area are

Birth weights of full-term babies in a certain area are normally distributed with mean 7.13 pounds and standard deviation 1.29 pounds. A newborn weighing 5.5 pounds or less is a low-weight baby. What is the probability t ...

In 2009 the hershey company of pennsylvania became the

In 2009, the hershey company of pennsylvania became the latest company to open a candy factory in mexico, joining other american candy companies including brach's confections and ferrara pan candy, which had opened plans ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As