Jumpinjava.cpp This Program Looks Up And Prints The Names And Prices Of Coffee Orders.
developerlaserq.netlify.app › Jumpinjava.cpp This Program Looks Up And Prints The Names And Prices Of Coffee Orders. ♥ ♥
Jumpinjava.cpp This Program Looks Up And Prints The Names And Prices Of Coffee Orders. Rating: 5,0/5 406 votes
Printing options: They focus on dye sublimation all-over-print (hence the name) and direct-to-garment printing. Unique features: Include your own custom packing slip in orders. You can also unlock discounts of up to 10% off, along with other custom branding options, like packaging stickers and private labeling features, with their paid plans. Raw download clone embed report print text 1.70 KB // JumpinJive.java - This program looks up and prints the names and prices of coffee orders. // Input: Interactive.
- // JumpinJive.java - This program looks up and prints the names and prices of coffee orders.
- // Output: Name and price of coffee orders or error message if add-in is not found.
- import java.util.Scanner;
- public class JumpinJive
- public static void main(String args[]) throws Exception
- // Declare variables.
- final int NUM_ITEMS = 5; // Named constant
- String addIns[] = {'Cream', 'Cinnamon', 'Chocolate', 'Amaretto', 'Whiskey'};
- double addInPrices[] = {.89, .25, .59, 1.50, 1.75};
- int x; // Loop control variable.
- double orderTotal = 2.00; // All orders start with a 2.00 charge
- // Get user input.
- System.out.print('Enter coffee add-in or XXX to quit: ');
- // Write the rest of the program here.
- {
- }
- for (x = 0; x < NUM_ITEMS; x++)
- if (foundIt)
- break;
- if (addIn addIns[x])
- foundIt = true;
- }
- if (foundIt)
- System.out.println(addIn + ' costs $' + addInPrices[x - 1] + '.');
- System.out.println('Total cost is $' + orderTotal + addInPrices[x - 1] + '.');
- else
- System.out.println('Sorry we do not carry that.');
- } // End of JumpinJive class.
- // JumpinJava.cpp - This program looks up and prints the names and prices of coffee orders.
- // Output: Name and price of coffee orders or error message if add-in is not found
- #include <iostream>
- using namespace std;
- int main()
- // Declare variables.
- const int NUM_ITEMS = 5; // Named constant
- string addIns[] = {'Cream', 'Cinnamon', 'Chocolate', 'Amaretto', 'Whiskey'};
- double addInPrices[] = {.89, .25, .59, 1.50, 1.75};
- int x = 0; // Loop control variable
- double orderTotal = 2.00; // All orders start with a 2.00 charge
- // Get user input
- cin >> addIn;
- // Write the rest of the program here.
- {
- }
- for (x = 0; x < NUM_ITEMS - 1; x++)
- if (addIn addIns[x])
- cout << addIn << ' costs $' << addInPrices[x] << '.' << endl;
- cout << 'Total cost is $' << orderTotal + addInPrices[x] << '.' << endl;
- else
- cout << 'Sorry we do not carry that.' << endl;
- }
- return 0;