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; }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education