Write a program named HoursAndMinutes

Write a program named HoursAndMinutes 1

Write a program named HoursAndMinutes that declares a minutes variable to represent minutes worked on a job, and assign a value to it.Display the value in hours and minutes. For example, if 98 is assigned to the minutes variable, the output would be: 98 minutes is 1 hours and 38 minutes.Note: For final submission assign 197 to the minutes variable



You have been contracted to create an application that can be used to determine the discount awarded for preferred customers. Because of the time limitation, you should focus your attention on the preferred customer class. Include data members of customer ID, customer name, and customer purchase. Define appropriate constructors and properties for the class.
Include a method that returns the discount percentage based on the following:
• When a preferred customer spends a minimum of $500, he or she gets a 5 percent discount
• When a preferred customer spends a minimum of $1,000, his discount is 6 percent
• When a preferred customer spends a minimum of $1,500, his discount is 7 percent discount
• When a preferred customer spends at least $2,000, he or she gets a 10 percent discount
Include an additional instance method that returns the actual reduced discounted price. Override the ToString( ) method to return the customer name, his purchase amount (formatted as currency), discount percentage (if any),and the reduced purchase price (formatted as currency).
Define the 2nd class to test your preferred customer class. You may instantiate your objects with literal data sent as arguments to the constructors. You do not have to input the data. USE YOUR OWN NAME AS THE CUSTOMER NAME FOR ONE OF THE OBJECTS THAT YOU INSTANTIATE. Before instantiating an object of the class, check to make sure the purchase amount entered is a positive integer. If the value entered for the purchase amount is negative, display an error message indicating the input is in-valid. Modularize your solution.
Sample output might look like:
Customer: Barbara Doyle
Purchase Amt. $1,423.78
Discount Percent: 6%
Discounted Amt.: $1,338.36
Customer: Sarah Wang
Purchase Amt. $401.28
Discount Percent: 0%
Discounted Amt.: $401.28


Screenshot 1-15

Create an application that simulates rolling a pair of dice. When the user clicks a button, the application should generate two random numbers, each in the range of 1 through 6 inclusive, to represent the value of the dice. Use PictureBox controls to display the dice. Use the dice images provided in the module or find your own dice images to use.


Screenshot 1-5

In the English measurement system, 1 yard equals 3 feet and 1 foot equals 12 inches. Use this information to create an application that lets the user convert distances to and from inches, feet, and yards. The user should enter the distance to be converted into a TextBox. A ListBox should be used to allow the user to select the units being converted from, and another ListBox should be used to allow the user to select the units being converted to.Be sure to handle the situation where the user picks the same units from both list boxes. The converted value will be the same as the value entered.A sample application form can be found in the text on page 265.


Screenshot 1-10

A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $20.00 per hour for labor.

Write a program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data:

The number of gallons of paint required
The hours of labor required
The cost of the paint
The labor charges
The total cost of the paint job


TicketsRUs 2

TicketsRUs needs an application to calculate ticket prices. There are three ticket prices:

• Orchestra $90 each
• Mezzanine $75 each
• Balcony $50 each

There is also a 20% discount on matinee performances .

Your application has the GUI shown below.

With the following named components:

Component Type Purpose
txtNum JTextField Input for number of tickets
chkMatinee JCheckBox Check if matinee performance
radOrchestra JRadioButton Check for orchestra tickets
radMezzanine JRadioButton Check for mezzanine tickets
radBalcony JRadioButton Check for balcony tickets
btnCalc JButton Click to calculate price
txtEach JTextField Displays price of each ticket
txtTotal JTextField Displays total price

Clicking the CalcPrice button should determine the price per ticket and the total price based on the user’s input and display in txtEach and txtTotal. You should make sure the number of tickets is entered and a ticket type is selected, otherwise give an error message.

The action listener for btnCalc is set up as follows.
btnCalc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
calcPrice(); //write the code for this method

Write the calcPrice method that is called by the action listener. This class method has access to all of the GUI components. You DO NOT HAVE TO CODE THE GUI. ONLY write the code for this method which does all the work. The header for the method is:

private void calcPrice()


HeadTailShow 3

Your client needs an application to that can display either the heads or tails of a coin. You need to create an application with a Show Heads button and a Show Tails button. When the user clicks the Show Heads button, an image of the heads side of a coin should appear. When the user clicks the Show Tails button, an image of the tails side of a coin should appear. The following figure shows how the application’s form should appear after either the Show Heads button or Show Tails buttons have been clicked.
Think carefully about your implementation. In particular how the form will look when the application firsts starts. Should any coins be showing?. For this question a GUI has been provided by the client. Make sure you implementation matches the clients requestThe client has supplied the images to be used. To achieve full marks, your solution must:Meets the client requirements specified above;
Work correctly;
Contain appropriate comments;
Use appropriate indentation; and
Follow conventions for naming variables and controls

Parking Charges

Parking Charges 4

Parking Charges

A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time.

Write an app that calculates and displays the parking charges for each customer who parked in the garage yesterday. You should enter the hours parked for each customer. The app should display the charge for the current customer and should calculate and display the running total of yesterday’s receipts. The app should use method CalculateCharges to determine the charge for each customer.

POS409 Week1 Pet’s Name

POS409 Week1 Pet's Name 5

Design, implement, test, and debug a C# program that displays a pet’s name when a button is clicked.

Create a graphical user interface (GUI) with a button labeled “Pet’s name.”
When the Pet’s name button is clicked, the program will display the name of the pet in a label on the form.


SlotMachine 6

A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images.If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user.Create an application that simulates a slot machine. The attached file shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user selects the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols in the Images \ Fruit Symbols folder of the Student Sample Programs.)If none of the randomly displayed images match, the program should inform the user that he or she has won $0. If two of the images match, the program should inform the user that he or she has won two times the amount entered. If three of the images match, the program should inform the user that he or she has won three times the amount entered. When the user selects the Exit button to exit the application, the program should display the total amount of money entered into the slot machine during this session and the total amount won. Upon exit, the total amount won is appended to a file that records each session’s total winnings.