Server IP : 172.16.15.8 / Your IP : 3.133.107.11 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/drsparks/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
#include <iostream> #include <iomanip> #include <fstream> // Main Fuction int main () { // Variables float mincharge, maxcharge, amountordered, distance, unitcost; char productch, classch, dummych; int bool errorincodes; // Report Heading // Set precision cout << fixed << setprecision(2); // Set Minimum and Maximum mincharge = 1e29; maxcharge = 0; // Loop section cin >> productch; while (productch != 'Z') { cin.get (dummych); cin.get (classch); cin >> amountordered >> distance; errorincodes = false; switch (productch) { case 'C': switch (classch) { case ' ': unitcost = 52.60; break; default: errorincodes = true; } break; case 'R': switch (classch) { case 'C': unitcost = 22.25; break; case 'G': unitcost = 16.50; break; case 'D': unitcost = 35.00; break; default: errorincodes = true; } break; case 'S': switch (classch) { case ' ': unitcost = 4.35; break; default: errorincodes = true; } break; case 'T': switch (classch) { case 'A': unitcost = 8.25; break; case 'B': unitcost = 6.50; break; case 'C': unticost = 5.40; break; default: errorincodes = true; } break; default: errorincodes = true; }