Hello, I have a question designing c++ code for a project. I took te class two y
ID: 3783038 • Letter: H
Question
Hello, I have a question designing c++ code for a project. I took te class two years ago and now I cannot recall how to input things correctly, but I have all the logic written out in an outline as to how you could code this project. It involves having thte user input an array of four values to be sorted for length, and how those lengths can be used to classify a system (The technical details dont need to be listed as I have everything outlined)
Can anyone help me with creating this code? I basically just need a translator to c++
Create an array with 4 values, user enters values
“Please enter ground link” cin assign value to G
“please enter input link” cin assign value to I
“Enter another” (doesnt need to be entered into a specific identification)
“another” (ditto)
Sort these values into lowest to highest in the array
If
(values in the array) 0+3 < 1+2 (smallest value + largest value < middle two values added together) -->
IF I (input link) is greater than G (ground link) , then cout “Barker Designation is GCCC Double Crank”
ELSE cout “Barker Designation is GCRR Crank Rocker”
ELSE IF
0+3 >1+2 cout “Barker Designation is RRRR Triple rocker”
ELSE IF
0+3 =1+2 à
If 0 = 3 or 1 = 2 cout “Barker Designation is S2X Challenge Point Parallelogram”
Else if 0 = 1 = 2 = 3 = 4 cout “Barker designation is S3X Square”
Else if 0 = I (Input is smallest value) cout “Barker Ddesignation SCRR Change Point Crank Rocker”
Else if 0 = G (Ground is smallest value) cout “SCCC Change Point Double Crank”
Else if cout “Classification is either SRCR Change Point Double Rocker, or SRRC Change Point
“Rocker Crank”
Let me know if you have questions about anything!
Explanation / Answer
cout << “Please enter ground link”;
cin >> G;
cout << “please enter input link”;
cin >> I;
cout << “Enter another”;
cin >> EA;
cout << “another” ;
cin >> EAA;
if(( array[0] + array[3] ) < (array[1] + array[2]) ){
elseif(( array[0] + array[3] ) > (array[1] + array[2]) ){
cout >> “Barker Designation is RRRR Triple rocker”;
}
elseif(( array[0] + array[3] ) == (array[1] + array[2]) ){
if( (array[0] == array[3] ) || (array[1] == array[2] )){
cout << “Barker Designation is S2X Challenge Point Parallelogram”;
}
elseif((array[0] == array[3] ) && (array[1] == array[2] ) && (array[1]==array[3]){
cout << “Barker designation is S3X Square”;
}
elseif(array[0]==I){
cout << “Barker Ddesignation SCRR Change Point Crank Rocker”;
}
elseif(array[0]==G){
cout << “SCCC Change Point Double Crank”;
}
else{
cout <<“Classification is either SRCR Change Point Double Rocker, or SRRC Change Point Rocker Crank” ;
}
}
}
Hope,my answer is helpful to you.I wrote everything.But,yet the last else if part is confusing.It don't have any condition.So ,i just took it as else.Remaining ,I wrote as per your instructions.
Any further help please feel free to ask us.We will love to help you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.