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; }
Step by step
Solved in 2 steps with 7 images