//C++ program
#include<iostream>
#include<math.h>
#define PI 3.14159265
using namespace std;
int main(){
double force1,force2,force3;
double angle1,angle2,angle3;
double F1x,F1y,F2x,F2y,F3x,F3y;
double Rx,Ry,R,angle;
char choice;
do{
cout<<"Enter magnitude of
force 1 : ";
cin>>force1;
cout<<"Enter angle of force 1
in degree (Please count the angle counterclockwise from the x axis)
: ";
cin>>angle1;
cout<<"Enter magnitude of
force 2 : ";
cin>>force2;
cout<<"Enter angle of force 2
in degree (Please count the angle counterclockwise from the x axis)
: ";
cin>>angle2;
cout<<"Enter magnitude of
force 3 : ";
cin>>force3;
cout<<"Enter angle of force 3
in degree (Please count the angle counterclockwise from the x axis)
: ";
cin>>angle3;
F1x = force1*cos
(angle1*PI/180);
F1y = force1*sin
(angle1*PI/180);
F2x = force2*cos
(angle2*PI/180);
F2y = force2*sin
(angle2*PI/180);
F3x = force3*cos
(angle3*PI/180);
F3y = force3*sin
(angle3*PI/180);
Rx = F1x+F2x+F3x;
Ry = F1y+F2y+F3y;
R = sqrt((Rx*Rx) + (Ry*Ry));
angle = atan(Ry/Rx)*180/PI;
cout<<"\nMagnitude of
Resultant force : "<<R<<"\n\n";
cout<<"Angle in degree
(counterclockwise from the x axis) :
"<<angle<<"\n\n";
cout<<"Do you want to find
more resultant (y/n) : ";
cin>>choice;
}while(choice=='y'||choice=='Y');
return 0;
}
//sample output
//Screen shots
This is a computer programming assignment to be done in C++ format. This assignment is based on computer language. If y...
GENERAL INSTRUCTIONS All requirements specified on page 64-67 of the course packet “2.5 Programming Assignment Submission Requirements” and “2.6 Flow Chart Symbols” should be followed. Plan the programs on paper before you attempt to write any programs (it will take less time to complete the assignment overall). Electronic version of your programs (the .m files you create) must be uploaded to Canvas. Attach multiple files to one submission. All files must be received by the beginning of...
Problem: Design and write a C language program that can be used to calculate Voltage, Current and Total Resistance for a Series or Parallel or a Series Parallel circuit. The program should display the main menu that contains the three types of circuit calculations that are available and then the user will be prompted to select a circuit first. After the circuit has been selected the program should then display another menu (i.e., a submenu) requesting the necessary data for...
this assignment should be delivered in C language Program 4 will prompt the user for one or two token, space delimited, inputs of at most 20 characters. If the user provides more than 20 characters before a newline is reached print the provided error message. If the number of tokens is incorrect, print the appropriate error message. If the input is correct, print the appropriate token types. Prompt the user for input (and provide output) until the user provides a...
Using Java programming language Your assignment is to implement a recursive reverse sorting algorithm. It should meet the following requirements: 1. The program shall graphically prompt the user for a file. 2. The program shall read the selected file which will contain 1 integer per line. 3. The program shall sort the values it reads from the file from largest to smallest. 4. The program shall write the values to an output file from largest to smallest in the same...
Programming in C with comments/steps 1. Overview The purpose of this assignment is to give you some experience with writing functions that take in arguments and return values, as well as writing a program that consists of multiple files. This assignment also requires the use of a switch statement, in addition to more practice with printf& scanf declaring variables, using loops, and using logical expressions. For this assignment, you will prompt the user in the main function to enter their...
Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its loyal customers. The rewards program offers three levels, Gold(G), Silver(S), and Bronze(B). Discounts on the customer’s sales receipt are provided in the table below along with additional discounts for only the amount of the purchase over $200.00. A maximum discount amount for any purchase is $30.00. Your program should prompt the user for their current reward level and sales receipt amount. Based on the...
Your mission in this programming assignment is to create a Python program that will take an input file, determine if the contents of the file contain email addresses and/or phone numbers, create an output file with any found email addresses and phone numbers, and then create an archive with the output file as its contents. Tasks Your program is to accomplish the following: ‐ Welcome the user to the program ‐ Prompt for and get an input filename, a .txt...
CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50 Points) Please do the following exercises: Pastoral College is a small college in the Midwest. Design the pseudo-code for a program that accepts a student name, major field of study, and grade point average. Display a student’s data with the message “Dean’s list” if the student’s grade point average is above 3.5, “Academic probation” if the grade point average is below 2.0, and no...
C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...
ELEN 1301-01 Programming Assignment #11 Due date: November 11, 2015. Wednesday (At the beginning of class.) Please submit: 1. Flowchart of your program. (4 points) 2. Printout of your C++ program with a heading comment (Do not forget to add comments within your program). (4 points) 3. Copy of a screenshot after your program is executed. (2 points) 4. You must use a two dimensional array in order to receive any credit. /* ELEN 1301-01 Programming Assignment #11. ...