Create Visual Basic projects to solve Programming Challenges 14 - Mass and Weight
Scientists measure an object's mass in kilograms and its weight in newtons. If you know the amount of mass an object, you can calculate its weight, in newtons, with the following formula:
Weight=mass*9.8
Create VB application that lets the user enter an object's mass and calculates its weight. If the object weighs more than 1000 newtons, display a message indicating that it is too heavy. If the object weighs less than 10 newtons, display a message indicating that it is too light.
Calculation of weight using mass:
Formula: Weight = mass * 9.8
C# Code:
using System; class HelloWorld { static void Main() { Console.WriteLine("Enter mass of the object in Kilograms"); double mass=Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Mass of given object is: "+mass+"kg"); double weight=mass*9.8; Console.WriteLine("Weight calculated from mass is: "+weight+"N"); if(weight>1000){ Console.WriteLine("The object is too heavy"); } if(weight<10){ Console.WriteLine("The object is too light"); } } }
The above code asks mass as user input and converts it into weight. If weight is >1000N it prints as heavy and if weight is <10N it prints as light.
Create Visual Basic projects to solve Programming Challenges 14 - Mass and Weight Scientists measure an...
I need Notebook++ coding! Thanks so much I will upvote! <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!--> <!-- --> <!-- --> <title> Jason Kidwell</title> <script> // // Scientists measure an object’s mass in kilograms and its weight in newtons. // If you know the amount of mass of an object in kilograms, you can calculate // its weight in newtons with the following formula: // // weight=mass×9.8 // // Write a...
(10pts). Consider the following: void fun1(void); void fun2(void); void fun3(void); void main() { Int a,b,c; … } void fun1(void){ Int b,c,d; … } void fun2(void){ Int c,d,e; … } void fun3(void){ Int d,e,f; … } Given the following calling sequences and assuming that dynamic scoping is used. What variables are visible during execution of the last function called? Include with each visible variable the name of the function in which it was...