#include #include using namespace std; // TODO: Define a generic method called CheckOrder() that //

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

#include #include using namespace std; // TODO: Define a generic method called CheckOrder() that //

Post by answerhappygod »

#include <string>#include <iostream>
using namespace std;
// TODO: Define a generic method called CheckOrder() that// takes in four variables of generic type asarguments.// The return type of the method isinteger
// Check the order of the input: return -1 forascending, // 0 for neither, 1 for descending
int main() { // Read in four strings string stringArg1, stringArg2, stringArg3,stringArg4; cin >> stringArg1; cin >> stringArg2; cin >> stringArg3; cin >> stringArg4; // Check order of four strings cout << "Order: " <<CheckOrder(stringArg1, stringArg2, stringArg3, stringArg4) <<endl;
// Read in four doubles double doubleArg1, doubleArg2, doubleArg3,doubleArg4; cin >> doubleArg1; cin >> doubleArg2; cin >> doubleArg3; cin >> doubleArg4; // Check order of four doubles cout << "Order: " <<CheckOrder(doubleArg1, doubleArg2, doubleArg3, doubleArg4) <<endl; return 0;}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply