his is a C++ programs and convert the program into a complete assembly program using MIPS. The selection is based on First Come First Serve calculate the ouput 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; }
this is a C++ programs and convert the program
into a complete assembly program using MIPS. The selection is based on
First Come First Serve
calculate the ouput 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; }
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 7 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)