Question

In: Computer Science

Program on Visual Basic, VBA Create an application that lets the user enter a number of...

Program on Visual Basic, VBA

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.

Solutions

Expert Solution

Code:-

Module Module1
Sub Main()
Dim sec As Double
'declare MC variable for calculate the minutes in given seconds
Dim MC As Double
'declare HC variable for calculate the hours in given seconds
Dim HC As Double
'declare DC variable for calculate the days in given seconds
Dim DC As Double
'get the seconds from user
Console.WriteLine("Enter the seconds: ")
sec = Console.ReadLine()
'check the seconds
If sec >= 60 And sec < 3600 Then
MC = sec / 60
Console.WriteLine("Minutes: " & MC)
Elseif sec >= 3600 And sec < 86400 Then
HC = sec / 3600
Console.WriteLine("Hours: " & HC)
Elseif sec >= 86400 Then
DC = sec \ 86400
Console.WriteLine("Days: " & DC)
End If
End Sub
End Module

Code Screenshot:-

Output:-

Please UPVOTE thank you...!!!


Related Solutions

Time Calculator Create a C++ program that lets the user enter a number of seconds and...
Time Calculator Create a C++ program 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...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse the sentence, and then display a sorted list of the words in the sentence with duplicate words removed. Tasks: Design a method (algorithm) to solve the above problem using pseudocode or a flowchart. Translate your algorithm into an appropriate VB program and test it using the following input sentence. "We are the world We are the children" Submit: Pseudocode version of algorithm/Flowchart version of...
Show: Create an application that allows the user to enter the number of calories and fat...
Show: Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *9 The percentage of...
Create a PYTHON program that lets a user guess a number from 1 to 1,000: -i...
Create a PYTHON program that lets a user guess a number from 1 to 1,000: -i used random.randint(1,1000) -must give hints like (pick a lower/higher number) which i already did -tell the user when he has repeated a number (help) -the game only ends when you guess the number (help) -you loose $50 every failed attempt (done) ****I did it as a while loop -
Project 5-3: Guessing Game Create an application that lets a user guess a number between 1...
Project 5-3: Guessing Game Create an application that lets a user guess a number between 1 and 100. Console Welcome to the Guess the Number Game ++++++++++++++++++++++++++++++++++++ I'm thinking of a number from 1 to 100. Try to guess it. Enter number: 50 You got it in 1 tries. Great work! You are a mathematical wizard. Try again? (y/n): y I'm thinking of a number from 1 to 100. Try to guess it. Enter number: 50 Way too high! Guess...
How to write a C++ program that lets the user enter a string and checks if...
How to write a C++ program that lets the user enter a string and checks if it is an accepted polynomial. Accepted polynomials need to have one term per degree, no parentheses, spaces ignored.
In Python: Design a program that lets the user enter the total rainfall for each of...
In Python: Design a program that lets the user enter the total rainfall for each of the 12 months into a list. The program should calculate and display the total rainfall for the year, the average monthly rainfall, the months with the highest and lowest amounts. However, to start, do not ask the user for input. Instead, hard code the monthly rainfalls as a list in your program, and then use the list to determine how to conduct the processing...
Fat Percentage Calculator Create a C++ program that allows the user to enter the number of...
Fat Percentage Calculator Create a C++ program that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *...
Design a program that lets the user enter the total rainfall for each of 12 months...
Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Requirements You must use the given function prototypes. You can add more functions if you like. def get_total_rainfall(months, months_len): def get_average_monthly_rainfall(months, months_len): def get_month_with_highest_rainfall(months, months_len): def get_month_with_lowest_rainfall(months, months_len): Design Considerations Use a global parallel array of...
DESIGN A FLOWCHART IN FLOWGORITHM Rainfall Statistics Design a program that lets the user enter the...
DESIGN A FLOWCHART IN FLOWGORITHM Rainfall Statistics Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall , and the months with the highest and lowest amounts. PLEASE AND THANK YOU
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT