this c++ program convert assemply language MIPS using visual studio. calculate the output using MIPS. 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; }

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

this c++ program convert assemply language MIPS using visual studio.

calculate the output using MIPS.

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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Variables
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr