What's new

Help C++ patulong

Status
Not open for further replies.

XieSmile

Eternal Poster
Joined
Feb 8, 2019
Posts
1,113
Reaction
390
Points
347
C++:
#include <iostream>

using namespace std;

int main() {

    string letter;
    char A,B,C,D,E;

    cout << "Choose A,B,C,D: ";
    getline(cin, letter);

    if (A>E) {
        cout << "Superior" << endl;
    } else if (B>E) {
        cout << "Very Good" << endl;
    } else if (C>E) {
        cout << "Good" << endl;
    } else if (D>E) {
        cout << "Poor" << endl;
    } else
        cout << "You choose the wrong letter. Please Try Again!" << endl;

    return 0;
}

Di ko po masyadong ma intindihan yung problem na binigay samin medyo bagohan pa po sa programming. Pano po maipalabas yung sa else na part po kapag mali yung letter na tinype mo?
 
Base sa google, sa "letter" nai-store kung anuman yung tinype mo so yun dapat ang gamitin mo sa conditional statement:

C++:
if (letter == "A") {

Pa-check na lang kung tama, handcoded lang yan.
 
Base sa google, sa "letter" nai-store kung anuman yung tinype mo so yun dapat ang gamitin mo sa conditional statement:

C++:
if (letter == "A") {

Pa-check na lang kung tama, handcoded lang yan.
Check ko nalang po mamaya or bukas sa makalawa maraming salamat po.
 
Status
Not open for further replies.

Similar threads

Back
Top