a) A local shop sells festival cookies at RM28.50 per box. The shop offers special discount for order of 20 boxes or more as shown helowa: Number of boxes Discount on total price More than 100 25% 80-100 20% 50-79 15% 20-49 10% Write a fragment of C++ code to accept the order quantity in boxes, then calculates and displays the total discount (if applicable) and total cost of the order. Prompts error message if invalid quantity is entered (zero or below). Display the total cost in 2 decimal places. Sample program run 1: Enter number of boxes you wish to order : -10 Sorry. Invalid order quantity. Sample program run 2: Enter number of boxes you wish to order: 50 Total discount is RM213.75 Total cost is RM1211.25
Q: Question 1 What is the outcome of the following code segment: x = [[1, 2]. [5, 6]. [8, 9]] x = [[a, ...
A: Given:
Q: Question 3 Construct a labeled diagram of Multilayer Perception Network (ANN-MLP) with one hidden la...
A: Consider the neural networ which contains :- three inputs one hidden layer two output
Q: programming Assume an integer array of size 12 named arrSales stores the sales of a product for eac...
A: // C++ implementation of above approach #include <bits/stdc++.h> using namespace std; /* Fun...
Q: Print the following pattern * * * * * * * * * * * * * * * * * * * ...
A: Answer
Q: Explain when you would prefer time-sharing processing over batch processing and why you would do so.
A: For the following reasons, we favor time-sharing processing to batch processing:- When we don't hav...
Q: An acronym is a word formed by taking the first letters of the words phrase and making a word from t...
A: Answer :
Q: What is the difference between a trunk and an access link?
A: Introduction: The other type of Layer 2 port offered by Cisco switches is a trunk link.To hear recor...
Q: Assume an ADT Stack which consists of the following attributes: struct StackNode { int item; StackNo...
A: A stack is a data structure that is used to store value in a manner of Last in First out. This means...
Q: WHAT IS CRYPTOCURRENCY AND HOW DOES IT WORK?
A: the answer is
Q: a) Determine the big theta running time of the method myMethod() by counting the approximate number ...
A: Given:
Q: Describe the four (4) constraints of syntactic analyzers.
A: Introduction: The syntactic analyzer is defined as the generation of a basic parse tree, which might...
Q: An interesting GUI component in Java is the Slider. Indeed, sliders allow a user to specify a numeri...
A: The thermometer can be implementer using the JSlider class and the label can be printed using the JL...
Q: WHAT EXACTLY IS A BYZANTINE GENERALS PROBLEM IN DIGITAL CASH TRANSACTIONS
A: Byzantine Generals Problem can be described as the trouble of decentralized frameworks having settl...
Q: Describe what is meant by offline password attacks. Name and describe in detail TWO(2) techniques t...
A: When a password is created, computer saves it hash form . When you enter password at login prompt, i...
Q: Give each of the three exception-handling mechanisms a name.
A: Intro Exception handling is the act of responding to the occurrence of exceptions - abnormal or unus...
Q: a) Write the C++ statements for following tasks: Declare a struct name GameRecord The members are ga...
A: The question is to write C++ code for the given problem.
Q: A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B, 70-79:C...
A: I give the code in Python along with output and code screenshot and explanation
Q: vern data link layer sta
A: Below the rules that govern data link layer standards
Q: he following system: An online shopping portal allows their customers to register to the portal. Th...
A: Use case diagram A use case diagram is a visual representation of a system's dynamic behavior. It i...
Q: Discuss relevant cybersecurity issues and how these emerging technologies (AI, analytics, blockchain...
A: BLOCKCHAIN: Blockchain is a system that ensures network security, transparency, and visibility via a...
Q: Which relational algebra operators can be used to join a pair of tables that are not union-compatibl...
A: Introduction: Relational Algebra: It is a procedural query language that accepts a Relation as input...
Q: 3.24) You are given a computer chip that is capable of performing linear filtering in real time, but...
A: Here is the detailed explanation of the solution
Q: Python question Write a program that counts the number of words in a sentence entered by the user.
A: Introduction: Here we are required to write a program that counts the number of words in a sentence ...
Q: What is the definition of a high-level programming language?
A: Introduction: A high-level language (HLL) is a programming language, such as C, FORTRAN, or Pascal, ...
Q: What are the characteristics of nonce?
A: Introduction: According to the question, we must determine what the characteristics of the nonce are...
Q: Briefly describe how you can use asymmetric key encryption to ensure the confidentiality of outgoing...
A: Let's understand how asymmetric encryption working with reference to symmetric encryption also: Symm...
Q: nvert the following python regex to a DFA: ^(A?(B|CD)*A+
A: SUMMARY: -Hence, we discussed all the points.
Q: Code 2.2 is for a program that demonstrates variable declarations and the use of literal and symboli...
A: 1. What are the two symbolic constants used? 2. Show two methods of defining a symbolic constant nam...
Q: How can one go about importing the turtle module?
A: Introduction: Turtle is a Python package that comes pre-installed that allows users to generate pict...
Q: Write a program to convert à US length in miles, yards, feet and inches to a Metric System length in...
A: I give the code in Python along with output and code screenshot
Q: Consider a hash table of size 11 with hash function h(x) = x mod 11. Draw the tablethat results afte...
A:
Q: crossover opPe A partial search tree for a two player game is given below. MAX MIN MAX O O O O O O O...
A: Answer the above questions are as follows:
Q: Write a statement that creates a list with the following strings (in that order) and assigns it to a...
A: I use python language for solving this...
Q: Let G = ({S,A,B,C,D,E,Z},(0,1),R,S), where R = {S → E | Z; E → A | C; A → 01B | 0A | ; B → 1B | 10A...
A: Introduction: Here we are required to to perform the asked questions on given set G = ({S,A,B,C,D,E,...
Q: In Java, explain public static void main(String args[])
A: The problem is based on the basics of java programming language.
Q: • Exercise Given a (7 , 4) non-systematic code 0 1 0 0 1 0 1 1 1 0 0 1 1 0 G= 0 1 1 0 1 1 1 |0 0 0 1...
A: Please refer below calculation for both parts :
Q: Perform the multiplication of two 4-bit unsigned binary numbers based on flowchart given below. Show...
A: Here, I have to provide a solution to the above question.
Q: hout internet ?
A: given - How does censorship grow and thrives in a place without internet ?
Q: You've learned that Software Design is both a process and a model. It is a guide for an easier/bette...
A: In order to develop any software, the framework which is used to define the system is known as SDLC ...
Q: Explain the ramifications of various network topologies as well as their business benefits. Concentr...
A: INTRODUCTION: Ith minimal risk of collision, but dependent on all nodes being wired up and in whole ...
Q: The following table shows a utility company's cost to supply a fixed amount of power to a new housin...
A: The Answer is
Q: The Linux operating system is a very popular server OS. A network administrator has to protect the l...
A: the code is an given below :
Q: Using the serial functions and serial monitor, determine the nun "e" transmitted in a string of data...
A: Lets see the solution.
Q: (Information technology and computer networking) Explain the similarities and differences between th...
A: Introduction: Is there a distinction between ICMP and ICMPv6? The Internet Control Message Protocol ...
Q: TOPIC: Recurrence what is the running time of the algorithms beding described (in big‐O notation)? S...
A: Please upvote me please. I need it badly. I am providing you the correct answer below. 1. An...
Q: What may be the commonalities between the meanings of Feeling and Agreeableness? Do your scores on F...
A: According to the Bartelby guideline we are suppose to answer only one question at a time Kindly repo...
Q: Explain and differentiate the SHA, RSA, and AES algorithms. Is there a role for hashing in the field...
A: Introduction: When a person signs in, you SHA the password they provide you, compare them, and make ...
Q: Explain how inline style sheets overrule the HTML document's style.
A: What is a Style Sheet: A Style Sheet is a collection of style rules that advises a browser on how to...
Q: What is a distributed denial of service assault, and how can a single individual coordinate one?
A: Intro The question is about distributed denial of service assault, and how can a single individual...
Q: Define Machine Learning and explain why it's vital. In analytic CRM, what function does it play? Is ...
A: Introduction: It is necessary to make a decision on machine learning and CRM in this situation.
C++
Step by step
Solved in 4 steps with 3 images
- turbo c++ code for The utilities commission has decided that the electric company overcharged its customer for 2 months last year. To make up the difference to the customers, the commission orders the company to decrease each of next month’s bill by 10%. The city also levies a 3% utility tax, which is to be applied to the bill before it is discounted. Also, the 10% discount does not apply to the utility tax. Assume electricity costs 25.50 per kilowatt. Create the program to compute for next month’s electricity bill.Pakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to5). Once per day, each agent passes in a slip for each different type of product sold. Every agentpasses in between 0 to 5 slips each day. Each slip has the following information on it: The agent number The product number Total rupees of that product sold that day.Write a program in C++ that will read all this information for last month’s sales and brief thetotal sales by agent by product. The output should be in tabular form.Final Exam triangle looks like the following: 1 1 0 1 1 1 0 0 1 1 1 1 1 0 0 1 1 Write a C++ function that receives row and position in the row in a Final Exam triangle and then compute any given position's value by taking the absolute value of subtracting the numbers to the position's right and left in the preceding row. For instance, to compute the middle number in the third row, you subtract 1 from 1; the sides of the triangle are always 1 because you only subtract the number to the upper left or the upper right (there being no second number on the other side). If the result is 1 the function returns true and returns false otherwise. In the case of receiving out of range values for row and position the function must return -1. For example row 1 can have position value 1 only. Row 2 can have position values 1, 2. Row 3 can have position values 1, 2, or 3. Etc..
- Internet Service provider An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program using c++ that calculates a customer's monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges.C++ Write a program that asks for the starting time and the number of minutes of the call, and displays the charges. The program should ask for the time to be entered as a floating-point number in the form HH.MM. For example, 07:00 hours will be entered as 07.00, and 16:28 hours will be entered as 16.28. Input Validation The program should not accept times that are greater than 23:59. Also, no number whose last two digits are greater than 59 should be accepted. Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part: num – static_cast<int>(num);C++ Write a program that takes as input an arithmetic expression followed by a semicolon ;. The program outputs whether the expression contains matching grouping symbols. For example, the arithmetic expressions {25 + (3 – 6) * 8} and 7 + 8 * 2 contains matching grouping symbols. However, the expression 5 + {(13 + 7) / 8 - 2 * 9 does not contain matching grouping symbols. If the expression contains matching grouping symbols, the program output should contain the following text: Expression has matching grouping symbol If the expression does not contain matching grouping symbols, the program output should contain the following text: Expression does not have matching grouping symbols.
- Final Exam triangle looks like the following: 1 1 1 1 1 1 0 0 0 1 1 10 0 1 1 1 Write a C++ function that receives row and position in the row in a Final Exam triangle and then compute any given position's value by taking the absolute value of subtracting the numbers to the position's right and left in the precedingrow. For instance, to compute the middle number in the third row, you subtract 1 from 1; the sides of the triangle are always 1 because you only subtract the number to the upper left or the upper right (there being no second number on the other side). If the result is 1 the function returns true and returns false otherwise. In the case of receiving out of range values for row and position the function must return -1. For example row 1 can have position value 1 only. Row 2 can have position values 1, 2. Row 3 can have position values 1, 2, or 3. Etc..c++ Write a program to use enumeration type to represent the seven colors of the rainbow, i.e. red, orange, yellow, green, blue, indigo and violet, as the enumerators in sequence, and red starts from 1. Then, ask the user to choose a value between the range of 1 – 7. If the user enters 3, the output will tell the user yellow has been chosen, and also display the previous and next colors of the chosen colors. If the user enters 1 or 7, display the chosen color and only next/previous color is displayed accordingly. Write the program in an infinite while loop, until a number which is beyond the range of 1 – 7 is entered. The sample output is as follows, Enter a number in the sequence of the rainbow color (1-7): 7 Violet is chosen. The previous color is indigo. Enter a number in the sequence of the rainbow color (1-7): 1 Red color is chosen. The next color is orange. Enter a number in the sequence of the rainbow color (1-7): 3Yellow is chosen. The previous color is orange and next…C++ code that given a date (year, month and day) finds and displays the next date. Consider all the details while solving the problem such as If the day entered is the last day of the month then it should display 1st of the next month and if the month is also the last month of the year then it should display 1st January of the next year. Also consider the leap year.
- C++ PROGRAMProblem Statement: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend offered help to create a program they can use. The program contains 3 options, 1st option is for Permutation, 2nd option is Combination and 3rd is for terminating the system. For option 1, Permutation, they uses the following formula: nPr = ; where r must not be greater than n. It should not proceed if this condition is not met. For 2nd option, Combination, they uses the formula : nCr = ; where r must not be greater than n as well. For the 3rd option, the program owner’s information shall be displayed, like name, subject code and account number, before the program terminates. Requirements: Develop the required system and use cpp for the file name Remember that both n and r are variables, their values shall only be entered at run time. The program requires the use of any looping The program requires the use of any conditional Introduce at…A salon offers coupons to its customers time to time. Without coupons adult haircut is 15.50 and the child haircut is 10.50. Coupons that this salon offers are color coded. The following table shows the color code and discount information Color code Green (code # 1) Blue (code # 2) Discount 3.50 from adult, 2.50 from kids 2.59 from adult, 1.50 from kids Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possible that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Write the program so it will generate the output as shown in the sample runs below where user input is in bold. Sample Run 1 Enter coupon color (0 = no coupon, 1 = green, 2 = blue): 1 Enter the type of haircut (a= adult or k = kid): a The charge is 12.00 Sample Run 2 Enter coupon color (0= no coupon, 1 = green, 2 = blue): 0…Please do in C++ coding please Nrite a program to fulfill the following requirements: You need a program to help you plan a garden. The user will enter - The square footage of their garden plot - Their needs for each of several types of plants (you won't know ahead of time how many types). For each plant they will specify the length of the rows, their width, and the number of rows. After each plant is entered, the program is to calculate the square footage used for that plant and display the remaining square footage left in the garden. The program should then ask them if they want to plant something else. If the user tries to enter too much for a plant compared to what is left, the program should tell them of their error and tell them the square footage that will actually be used for that plant. The user is not required to fill their garden space. When the user is done entering plants, the program should display the total square footage used, the number of plant types and the amount of…