A phone call cost 10 cents per minute. Write a program that generates two random numbers for hours and minutes and calculate the cost of the call. Look at exercise 12.6page 224 that shows how to create a random number.(Note: there is no input from the user).
Button Make a call
When this button is clicked, two random numbers are generated. A call cannot be more than 5 hours long. The generated hours and minutes are displayed on labels. Calculate the cost of the call in minutes and display it on a label.
The use of correct types, formatting and constants will earn you marks.
1
Expert's answer
2012-08-23T08:42:44-0400
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
namespace Phone_call { public partial class Form1 : Form { private int hours; private int minutes; public Form1() { InitializeComponent(); }
Comments
Leave a comment