Questions
I'm having a bit of an issue with one of my C++ labs. It's not for...

I'm having a bit of an issue with one of my C++ labs. It's not for score but I need to understand it so I can move on.

A restaurant servers burgers for $8 and salads for $7.

When the customer selects a burger they must choose if they would like cheese. If they do, cheddar costs an additional 25 cents while pepper jack is 50 cents.

When the customer selects a salad they must choose if they would like no dressing, ranch for 10 cents more, and honey mustard for 15 cents more.

Customers can buy a drink for $1.50

Use the question prompts already declared as strings to ask the user for responses and then calculate the total cost the customer owes.

The code I wrote is as follows:

#include <iostream>
using namespace std;

int main() {

   int burgerOrSalad, cheese, kindOfCheese, dressing, drink;
  
   string q1 = "Would you like a 1) burger or 2) a salad?";
   string q2 = "Would you like cheese? 0) No or 1) Yes";
   string q3 = "What kind of cheese 1) Cheddar or 2) Pepper jack?";
   string q4 = "What kind of dressing would you like 0) None, 1) Ranch, 2) Honey Mustard?";
   string q5 = "Would you like a drink? 0) No, 1) Yes";

   cout << q1 << endl;
   cin >> burgerOrSalad;

   double cost = 0;

   cout << q2 << endl;
   cin >> cheese;

   cout << q3 << endl;
   cin >> kindOfCheese;

   cout << q4 << endl;
   cin >> dressing;

   cout << q5 << endl;
   cin >> drink;
    
   if ( burgerOrSalad == 1 ) {
       cost = 8.00;
   }
      if ( cheese == 1 ) {
      }
         else if ( kindOfCheese == 1 ) {
            cost = 8.25;
         }
         else if ( kindOfCheese == 2 ) {
            cost = 8.50;
         }

   if ( burgerOrSalad == 2 ) {
       cost = 7.00;
   }
      else if ( dressing == 1 ) {
         cost = 7.10;
      }
      else if ( dressing == 2 ) {
         cost = 7.15;
      }

   if ( drink == 1 ) {
       cost = 1.50;
   }
   cout << "Total cost of selected meal is " << cost << endl;
   return 0;
}

How can I add the cost if the input is 1 1 1 1?

I'm so lost.

In: Computer Science

Create a c file to read from an existing file one character at a time and...

Create a c file to read from an existing file one character at a time and print that character to the console

Create a c file to read a character from the standard input and write it to a file.

please help me

In: Computer Science

Please no plagiarism and must be in your own 500 words How do you feel blockchain...

Please no plagiarism and must be in your own 500 words

How do you feel blockchain will change the global economy or will it? Explain your answer

In: Computer Science

Write a Java application that checks a string for correct parenthesization. The input comes from the...

Write a Java application that checks a string for correct parenthesization. The input comes from the keyboard and should (but might not) consist solely of the delmiters (, ), [, ], {, and } separated by whitespace.

The output of the program must include following:

  • OK
  • Opener/closer mismatch
  • Missing closer
  • Missing opener
  • Unexpected symbol

The name of your class should be ParenChecker.

For example, if the input was:

( [ { } ] )

the program should produce the following output:

OK

and if the input was:

(

the program should produce the output:

Missing closer

etc...

In: Computer Science

Assume that the following Ada like program compile successfully. int k = 0; A[3] = {0,...

Assume that the following Ada like program compile successfully.

int k = 0;
A[3] = {0, 1, 2};

void f(int p) {
     cout<< A[k];
     p*=3;
     cout<< A[k];
     p*=3;
     cout<< A[k];
}

int main () {
     f(A[k++]);        // postfix
     cout << A[1] << A[2] << endl;
{

   What is printed on the screen assuming?

  1. Pass by value
  2. Pass by reference
  3. Pass by value-result (assume lvalue is computed at call time)
  4. Pass by value-result (assume lvalue is computed at run time)

In: Computer Science

What is IT governance referring to a Company? Why is IT governance important to a company...

What is IT governance referring to a Company?

Why is IT governance important to a company and  How does one implement it.

In: Computer Science

You have been asked to build an admin portal that will allow your company internal employees...


You have been asked to build an admin portal that will allow your company internal employees to access the portal and perform admin functions on behalf of company clients.

Here are additional details:

(a) Admin portal is accessible only on company network to only company employees that have one of the "ADMIN" roles.
(b) Access to the links is role based i.e. only authenticated internal employees with "ADMIN" role are able to access the portal and what links you can access once on the portal is determined based on what other roles you have. So, same link will not be visible to other admin who doesn't have appropriate role to access the link.
(c) There are five categories of applications and 5 admin roles for each category. Here are the details:

#   Category   Role           Access                               Links
====================================================================================================================================================
1.   Global       ADMIN           All Global links                       {Manage User Accounts, Assign Roles, Help Desk}
2.   Finance       FINANCE_ADMIN       All Global links + All Finance Category links           {Finance Reports, Accounts Payable, Accounts Receivables, Tax}
3.   Sales       SALES_ADMIN       All Global links + All Sales Category links           {Sales Reports, Sales Leads, Sales Demo}
4.   HR       HR_ADMIN       All Global links + All HR Category links           {New Hire, On-boarding, Benefits, Payroll, Terminations, HR Reports}
5.   Engineering   ENGG_ADMIN       All Global links + All Engineering Category links       {Application Monitoring, Tech Support, App Development, App Admin, Release Management}

(d) The links redirect users to the admin application that is not developed by you. You are only providing links to the portal and redirect users to appropriate application.

Deliverables:

1. Provide detailed overall solution architecture of the solution that you propose. Discuss each component in the diagram. (Hint: MVC or multi-tier) (40)
IMPORTANT: just high level diagram will NOT suffice. Each component discussion is a must.

2. Use Case diagrams for each function that user can perform. (30)

3. Sequence diagrams for each function that user can perform. (30)

Here are some architecture examples:
https://www.edrawsoft.com/software-architecture-example.php

In: Computer Science

Create 1 HTML page and 1 CSS file for all the styles. Your html page will...

Create 1 HTML page and 1 CSS file for all the styles. Your html page will be a small gallery of images using the Polaroid style. The page should have at least 1 row of 3 images. You can choose any theme of images. Don't pick random images, make them all have a theme. Add an h1 tag for the header of your page. Style the h1 tag with a color, size, and font family. Include a paragraph tag under the h1 tag that is a description of your image gallery. Also style the paragraph with a color and font family.

In: Computer Science

Please write code in c++ using iostream library. Also you can use any string library. Create...

Please write code in c++ using iostream library. Also you can use any string library.

Create structure plane with the following:

1)plane's ID[int type]

2) location[char*]

3) departure time[char*]

Your task is to find the plane with the smallest departure time for the selected city.

Pointer, dynamic array and structures have to be used in this code.

Input:

NOTE: It's just an example of input, you should write code generally for any inputs.

First line contains n(0 < n < 1001)

Then n lines inputed in given format:

First - plane's ID[int type]

Second - location address[char*]

Third - departure time[char*]

Departure city.

example of input:

3

21 LoNdon 23:00

02 Bath 10:00

03 LondoN 22:00

LonDon

Output: example of output: 1_LONDON_22:00 output should be in uppercase

Ouput the information in the following format ID_LOCATION_TIME If there is more that one plane - output with smallest time. If there is no case to go by plane output "Impossible".

In: Computer Science

AND( OR(OR(X,Y), AND(OR(X,Y), OR(NOT(X), NOT(Y)))), OR(OR(X,Y), AND(OR(X,Y), NAND(X,Y))) ) is equivalent to: A. OR(X,Y) B. AND(X,Y)...

AND( OR(OR(X,Y), AND(OR(X,Y), OR(NOT(X), NOT(Y)))), OR(OR(X,Y), AND(OR(X,Y), NAND(X,Y))) )

is equivalent to:

A. OR(X,Y) B. AND(X,Y) C. NOR(X,Y) D. XOR(X,Y) E. NAND(X,Y) F. XNOR(X,Y)

How do I simplify this with the Idempotence, De morgan, absorbtion law, etc and waht are the steps to break it down?

In: Computer Science

Discuss three main information security challenges faced by organizations. Focus on prevention and troubleshooting.

Discuss three main information security challenges faced by organizations. Focus on prevention and troubleshooting.

In: Computer Science

prove the running time of heap sort.

prove the running time of heap sort.

In: Computer Science

(1) What are the advantages and disadvantages to using the int data type rather than the...

(1) What are the advantages and disadvantages to using the int data type rather than the bool data type to manipulate Boolean expressions? Why do students think the int data type is still used for Boolean expressions?

(2) Discuss how C++ provides two-way selection through the if…else statement. Explain the syntax of this statement. Also, explain how the bool data type is used in C++ to manipulate Boolean expressions.

In: Computer Science

IN JAVA write a program that creates an array of strings with 8 people in it....

IN JAVA write a program that creates an array of strings with 8 people in it. Second,  Assign a random rank between 1 to 8 to each of the players. The rankings do not change throughout the tournament. Finally, Sort the players based on the rankings and print the data (show rankings of players, in square brackets, at every step after they are ranked).
USING JAVA COLLECTIONS IS NOT ALLOWED

In: Computer Science

Consider the following schema: Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog(sid, pid, cost) In a plain...

Consider the following schema:

Suppliers(sid, sname, address)
Parts(
pid, pname, color)
Catalog(sid,
pid, cost)

In a plain text file, write the following queries in SQL:

  1. Find the names of all suppliers who supply a green part.
  2. Find the names of all suppliers who are from Illinois.
  3. Find the names of all suppliers who sell a red part costing less than $100.
  4. Find the names and colors of all parts that are green or red.

In writing these queries you may make the following assumptions:

a. Each part has only one color.
b. The cost field is a real number with two decimal places (e.g., 100.25, 93.00).
c. The sid field in Suppliers and the sid field in Catalog refer to the same field.
d. The pid field in Parts and the pid field in Catalog refer to the same field.

In: Computer Science