Question: Go to godbolt.org and copy the below C++ program into the compiler and convert to x86 code. Copy the x86 instructions into a document and

Go to godbolt.org

and copy the below C++ program into the compiler and convert to x86 code.

Copy the x86 instructions into a document and add comments explaining the code of x86 version.

Ignore the constructor aspects of x86.

You should have at least 25 lines of explanation for the converted x86 code.

#include

#include

#include

#include

using namespace std;

float const LABOR = 4.15;

float const TAX = 0.085;

int main() {

string customers_name;

float room_length, rooms_width , price_sq_ft , discount, size, cost , labor_cost, installed_cost, discount_price, sub_total, taxes, final_cost ;

// Input Section

cout << "Customer's' Name : ";

getline (cin,customers_name);

cout << "Room's Length : ";

cin >> room_length;

cout << "Room's Width : ";

cin >> rooms_width;

cout << "Price / Sq Ft : ";

cin >> price_sq_ft;

cout << "Discount Rate : ";

cin >> discount;

// Processing Section

size = ceil(room_length * rooms_width);

cost = price_sq_ft * size;

labor_cost = LABOR * size;

installed_cost = cost + labor_cost;

discount_price = installed_cost/discount;

sub_total = installed_cost - discount_price;

taxes = sub_total * TAX;

final_cost = sub_total + taxes;

// Output Section

cout<

cout << " "<

cout << "Welcome to Passaic County Carpeting Company"<

cout << " "<

cout << "Customer information:"<

cout << "\tCustomer Name:""\t\t"<

cout << "\tCarpet Size:""\t"<

cout << "Charges:"<

cout << "\tCarpet Cost: @ $"<

cout << "\tLabor Cost: @ $"<

cout << "\tInstalled Price:\t\t$"<

cout << "\tDiscount:\t\t\t$"<

cout << " \t\t __________"<

cout << "\tSubTotal: \t\t$"<

cout << "\tTaxes: \t\t$"<

cout << "\tTotal Cost: \t\t$"<

cout <

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!