Question

In: Computer Science

COSC 1436 Programming Assignment : Skill Practice Assignment 3 Your skill practice assignment this week will...

COSC 1436 Programming Assignment :

Skill Practice Assignment 3

Your skill practice assignment this week will be programming challenge #6 on page 374 - Kinetic Energy

In it you are asked to write a programing that returns the amount of kinetic energy the object has. You will ask the user to enter values for mass and velocity. You will need to create a function named kinetic Energy that accepts an object's mass (in kilograms) and velocity (in meters per second) as arguments. The function will return the amount of kinetic energy that the object has. You will display the results to the user.

Read the programming assignment in the book. Make sure to do what the specification is asking you to do. All of what it is asking you to do. You probably want to use variables of type double, not int.

Solutions

Expert Solution

Solution:- First of all, we know the formula of Kinetic Energy, which is used to find the K.E. of an object with the help of its mass and velocity.

Kinetic Energy = 1/2(MV2)

NOTE **:- I'm using C++ Language for the Problem.

Code...

#include<iostream>
using namespace std;
// function for Kinetic Energy of Object
double kinetic_Energy(double mass, double velocity){
   double KE = mass*(velocity*velocity)/2;
   return KE;
}

int main(){
   double mass,velocity,result;
   cout<<"Enter The Mass Of Object (Should be in Kg) : ";
   cin>>mass;
   cout<<"\nEnter The Velocity Of Object (Should be in m/s) : ";
   cin>>velocity;
   cout<<"\nmass : "<<mass<<" Kg, Velocity : "<<velocity<<" m/s";
   result=kinetic_Energy(mass,velocity);
   cout<<"\n\nKinetic Energy Of The Object is : "<<result;
}


Related Solutions

Programming Assignment #3: SimpleFigure and CirclesProgram Description:This assignment will give you practice with value...
Programming Assignment #3: SimpleFigure and CirclesProgram Description:This assignment will give you practice with value parameters, using Java objects, and graphics. This assignment has 2 parts; therefore you should turn in two Java files.You will be using a special class called DrawingPanel written by the instructor, and classes called Graphics and Color that are part of the Java class libraries.Part 1 of 2 (4 points)Simple Figure, or your own drawingFor the first part of this assignment, turn in a file named...
The purpose of this C++ programming assignment is to practice using an array. This problem is...
The purpose of this C++ programming assignment is to practice using an array. This problem is selected from the online contest problem archive, which is used mostly by college students worldwide to challenge their programming ability and to prepare themselves for attending programming contests such as the prestige ACM International Collegiate Programming Contest. For your convenience, I copied the description of the problem below with my note on the I/O and a sample executable. Background The world-known gangster Vito Deadstone...
Objective: The purpose of this programming assignment is to practice using STL containers. This problem is...
Objective: The purpose of this programming assignment is to practice using STL containers. This problem is selected from the online contest problem archive (Links to an external site.), which is used mostly by college students world wide to challenge their programming ability and to prepare themselves for attending programming contests such as the prestige ACM International Collegiate Programming Contest (Links to an external site.). For your convenience, I copied the description of the problem below with my note on the...
Program in Java using Inheritence The purpose of this assignment is to practice OOP programming covering...
Program in Java using Inheritence The purpose of this assignment is to practice OOP programming covering Inheritance. Core Level Requirements (up to 6 marks) The scenario for this assignment is to design an online shopping system for a local supermarket (e.g., Europa Foods Supermarket or Wang Long Oriental Supermarket). The assignment is mostly concentrated on the product registration system. Design and draw a UML diagram, and write the code for the following classes: The first product category is a fresh...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your...
Complete the 3 programming problems in this assignment by using Microsoft Visual Studio Suite. Compile your solutions for each problem solved in a Word or Google document which includes (a) the pseudocode, (b) the C# codes and (c) the execution result (screen capture just the answer part using Snipping Tool, avoiding non-related or blank spaces). Notice for readability, that the (a) & (b) are in text mode and the (c) is in image mode. Use proper titles and wording in...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will...
In this assignment, you will practice solving a problem using object-oriented programming and specifically, you will use the concept of object aggregation (i.e., has-a relationship between objects). You will implement a Java application, called MovieApplication that could be used in the movie industry. You are asked to implement three classes: Movie, Distributor, and MovieDriver. Each of these classes is described below. The Movie class represents a movie and has the following attributes: name (of type String), directorsName (of type String),...
Your assignment this week is to tell me in 2-3 paragraphs..in your own words... what marketing...
Your assignment this week is to tell me in 2-3 paragraphs..in your own words... what marketing research is and why is it necessary?? Then....... After this information I want you to give me a specific example of marketing research from beginning to end. You will not only find an example and tell me about it but you will also show me a visual example whether you copy/paste the visual example into your summary paper or if you provide me with...
MGMT5018 Individual Assignment 1 Week 3 MGMT 5018 Individual Assignment # 1, Due in Week 4...
MGMT5018 Individual Assignment 1 Week 3 MGMT 5018 Individual Assignment # 1, Due in Week 4 - 15% of Overall Mark You are the appointed Supply Chain Manager for a company that manufactures and sells its products to retailers and to end consumers. The company uses its own trucks to deliver to retailers and UPS for its online orders to deliver to end consumers. Apply your understanding of the 5 components of Supply Chain by explaining to me as your...
MGMT5018 Individual Assignment 1 Week 3 MGMT 5018 Individual Assignment # 1, Due in Week 4...
MGMT5018 Individual Assignment 1 Week 3 MGMT 5018 Individual Assignment # 1, Due in Week 4 - 15% of Overall Mark You are the appointed Supply Chain Manager for a company that manufactures and sells its products to retailers and to end consumers. The company uses its own trucks to deliver to retailers and UPS for its online orders to deliver to end consumers. Apply your understanding of the 5 components of Supply Chain by explaining to me as your...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT