this is a  C++ programs and convert the program into a complete assembly program using MIPS. calculate the total cost using MIPS. #include int main() {     int adults;     int children;     double totaladults;     double totalchildren;     double total;     char option;     std::cout << "Welcome to Happy Tour Agency" << std::endl;     std::cout << "We have a special rate for 3 days and 2 nights at Langkawi Island,\n"         "Pangkor Island, and Tioman Island" << std::endl;     std::cout << "Full cost for 3 days for an adult are as follows: " << std::endl;     std::cout << "Destination Flight(2 ways) Hotel(3 days)\n"         "Langkawi RM 120.00 RM 260.00\n"         "Pangkor RM 90.00 RM 330.00\n"         "Tioman RM 150.00 RM 390.00" << std::endl;     std::cout << "50% discount for each child" << std::endl;     std::cout << std::endl;     std::cout << "Please enter the number of adults that are going: ";     std::cin >> adults;     std::cout << "Please enter the number of children that are going: ";     std::cin >> children;     std::cout << "Please enter your destination :" << std::endl;     std::cout << "[L] Langkawi\n"         "[P] Pangkor \n"         "[T] Tioman" << std::endl;     std::cin >> option;     switch (option) {     case 'L':     case 'l':         totaladults = (adults * 120) + (adults * 260);         totalchildren = (children * 120 / 2) + (children * 260 / 2);         break;     case 'P':     case 'p':         totaladults = (adults * 90) + (adults * 330);         totalchildren = (children * 90 / 2) + (children * 330 / 2);         break;     case 'T':     case 't':         totaladults = (adults * 150) + (adults * 390);         totalchildren = (children * 150 / 2) + (children * 390 / 2);         break;     default:         std::cout << "The option is not valid" << std::endl;         break;     }     total = totaladults + totalchildren;     std::cout << "The total cost for your vacation: " << total << std::endl;     return 0; }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

this is a  C++ programs and convert the program
into a complete assembly program using MIPS.

calculate the total cost using MIPS.

#include <iostream>

int main() {
    int adults;
    int children;
    double totaladults;
    double totalchildren;
    double total;
    char option;

    std::cout << "Welcome to Happy Tour Agency" << std::endl;
    std::cout << "We have a special rate for 3 days and 2 nights at Langkawi Island,\n"
        "Pangkor Island, and Tioman Island" << std::endl;
    std::cout << "Full cost for 3 days for an adult are as follows: " << std::endl;
    std::cout << "Destination Flight(2 ways) Hotel(3 days)\n"
        "Langkawi RM 120.00 RM 260.00\n"
        "Pangkor RM 90.00 RM 330.00\n"
        "Tioman RM 150.00 RM 390.00" << std::endl;
    std::cout << "50% discount for each child" << std::endl;
    std::cout << std::endl;
    std::cout << "Please enter the number of adults that are going: ";
    std::cin >> adults;
    std::cout << "Please enter the number of children that are going: ";
    std::cin >> children;
    std::cout << "Please enter your destination :" << std::endl;
    std::cout << "[L] Langkawi\n"
        "[P] Pangkor \n"
        "[T] Tioman" << std::endl;
    std::cin >> option;

    switch (option) {
    case 'L':
    case 'l':
        totaladults = (adults * 120) + (adults * 260);
        totalchildren = (children * 120 / 2) + (children * 260 / 2);
        break;
    case 'P':
    case 'p':
        totaladults = (adults * 90) + (adults * 330);
        totalchildren = (children * 90 / 2) + (children * 330 / 2);
        break;
    case 'T':
    case 't':
        totaladults = (adults * 150) + (adults * 390);
        totalchildren = (children * 150 / 2) + (children * 390 / 2);
        break;
    default:
        std::cout << "The option is not valid" << std::endl;
        break;
    }

    total = totaladults + totalchildren;

    std::cout << "The total cost for your vacation: " << total << std::endl;

    return 0;
}

Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY