Question

VISUAL BASIC FOR APPLICATIONS PLEASE! Create an application that lets the user enter a number of...

VISUAL BASIC FOR APPLICATIONS PLEASE!

Create an application that lets the user enter a number of seconds and produces output according to the following criteria:

There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds.

There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours in that many seconds.

There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86,400, the program should display the number of days in that many seconds.

Homework Answers

Answer #1

'Vb Code

Module Module1

Sub Main()
Dim sec As Integer
Const MINUTE = 60, HOURS = 3600, DAYS = 86400
'prompt user to enter seconds
Console.Write("Enter a number of seconds: ")
sec = Integer.Parse(Console.ReadLine())
If sec >= 60 And sec < 3600 Then
Dim min = sec / MINUTE
Console.WriteLine("The Minutes: " & min.ToString("F2"))
ElseIf sec >= 3600 And sec < 86400 Then
Dim hour = sec / HOURS
Console.WriteLine("The Hours: " & hour.ToString("F2"))
ElseIf sec >= 86400 Then
Dim day = sec / DAYS
Console.WriteLine("The Days: " & day.ToString("F2"))


End If
'pause
Console.WriteLine("Press any key to terminate...")
Console.ReadLine()


End Sub

End Module

'Output

//If you need any help regarding this solution...... please leave a comment... thanks

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
VISUAL BASIC FOR APPLICATIONS PLEASE!!!! A long distance provider charges the following rates for telephone calls:...
VISUAL BASIC FOR APPLICATIONS PLEASE!!!! A long distance provider charges the following rates for telephone calls: Rate Category Rate Per minute Daytime (6:00A.M through 5:59P.M) $0.07 Evening (6:00P.M through 11:59P.M) $0.12 Off Peak (12:00A.M through 5:59A.M) $0.05 Create an application that allows the user to select a rate category and enter the number of minutes of the call, then display the charges. Use the following test data to determine if the application is calculating properly: Rate Category and Minutes Charge...
Please Write code in visual studio Roman Numeral Converter Write a program that asks the user...
Please Write code in visual studio Roman Numeral Converter Write a program that asks the user to enter a number within the range of 1 through 10. Use a switch statement to display the Roman numeral version of that number. Input Validation: Decide how the program should handle an input that is less then 1 or greater than 10.
Create a C# application You are to create a class object called “Employee” which included eight...
Create a C# application You are to create a class object called “Employee” which included eight private variables: firstN lastN dNum wage: holds how much the person makes per hour weekHrsWkd: holds how many total hours the person worked each week. regHrsAmt: initialize to a fixed amount of 40 using constructor. regPay otPay After going over the regular hours, the employee gets 1.5x the wage for each additional hour worked. Methods:  constructor  properties  CalcPay(): Calculate the regular...
Make Windows Forms App (NET Framework) Language should be Visual Basic This is the extension of...
Make Windows Forms App (NET Framework) Language should be Visual Basic This is the extension of the console application, but we would be using UI in forms project. So Create a forms project this time and create three Labels and three textfields and submit button as shown. The only difference between the console and forms project in this application, we would be converting the data entered in a textbox. As you know, text entered in a textbox is a string....
1)Write a program that asks a user for a number. If (and only if) the number...
1)Write a program that asks a user for a number. If (and only if) the number is greater than zero print “The number is valid” 2)Write a program that asks a user for a grade. If (and only if) the grade is greater than zero and less than 101, print “The grade is valid” 3)Write a program that asks a user how many widgets they want to buy and prints out what the user should pay. Widgets costs 10 dollars....
Create a program named admission that takes as Input the student name, GPA and the admission...
Create a program named admission that takes as Input the student name, GPA and the admission Test Score, the application should display if the student got accepted or rejected. The program should use a function named AcceptOrReject( gpa, testScore) to control the program. Acceptance is based on the following criteria: The student can get accepted in the following two cases : 1- if the GPA is less than 3.0, the test score has to be more than 80 to get...
The following program allows the user to enter the grades of 10 students in a class...
The following program allows the user to enter the grades of 10 students in a class in an array called grade. In a separate loop, you need to test if a grade is passing or failing, and copy the grade to an array to store passing or failing grades accordingly. A passing grade is a grade greater than or equal to 60. You can assume the use will enter a grade in the range of 0 to 100, inclusive. ...
In Assignment 1, you created a program for Marshall’s Murals that prompts a user for the...
In Assignment 1, you created a program for Marshall’s Murals that prompts a user for the number of interior and exterior murals scheduled to be painted during the next month. The program computes the expected revenue for each type of mural when interior murals cost $500 each and exterior murals cost $750 each. In this assignment, you are going to design a GUI version using Visual Studio Form. The programs prompt a user for the number of interior and exterior...
Create a Software Application for XYZ Bank that allows its members to access their bank account...
Create a Software Application for XYZ Bank that allows its members to access their bank account information through an “ATM like” interface. The Menu Options should include: checking the account balance, debiting the account and crediting the account, along with an option to exit the program. Create an Account Class to represent the customers’ bank accounts. Include a data member of type float to represent the account balance. Provide a constructor that receives an initial balance and uses it to...
C# Programming Using the Example provided in this Week Folder,Create a Console application that solve the...
C# Programming Using the Example provided in this Week Folder,Create a Console application that solve the following problem: The heating system in a school should be switched on if the average temperature is less than 17 degrees Celsius. The average temperature is found from the temperatures in the Math, English and IT departments. You are required to write a program that allows the user to input 3 temperatures. The program calculates and displays the average temperature and then displays "heating...