For this assignment you will develop pseudocode and write a C++ program for a simple calculator. You will create both files in Codio. Put your pseudocode and C++ code in the files below.
PSEUDOCODE FILE NAME: Calculator.txt
C++ SOURCE CODE FILE NAME : Calculator.cpp
DESCRIPTION:
Write a menu-driven program to perform arithmetic operations and computations on a list of integer input values. Present the user with the following menu. The user will choose a menu option. The program will prompt the user for 2 whole numbers (integers), perform the operation specified by the menu option and then display the result. Name your file Calculator.cpp.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice:
Suppose the user chooses option (A). The program will prompt the user for 2 numbers, add them and display the sum, then thank the user.
Enter first number: 3
Enter second number 8
The sum is 11
Thank you for using the Calculator.
The program ends after giving the result.
Supposed the program is run again and the user enters option S. The program will subtract the second number from the first and present the result.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: S
Enter first number: 4
Enter second number: 6
The difference is -2
Thank you for using the Calculator.
Option M will multiply the 2 numbers. Option D will divide the first number by the second. Option R will produce the remainder after dividing the first number by the second. If the user chooses (Q) the program exits with a message : “is turned off”
If the user enters an illegal option, the program should show an error message then end. For example.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: G
invalid choice
NOTE:
Your menu should appear exactly as it is shown above.
The prompts for the user and the output for the results should appear exactly as specified above.
The menu options are case insensitive. The Calculator should accept upper-case ‘M’ and lower-case 'm’.
Account for invalid operations such as dividing a number by zero or attempting to get the remainder after dividing by zero. In the event that happens print “The remainder is Error”
More Examples
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: a
Enter first number: 5
Enter second number: 4
The sum is 9
Thank you for using the Calculator.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: R
Enter first number: 8
Enter second number: 10
The remainder is 8
Thank you for using the Calculator.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: m
Enter first number: 3
Enter second number: 2
The product is 6
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: D
Enter first number: 5
Enter second number: 0
The division is Error
Thank you for using the Calculator.
MY CALCULATOR
A) Add
S) Subtract
M) Multiply
D) Divide
R) Remainder (Mod)
Q) QUIT (turn off)
Enter Menu Choice: Q
is turned off
Thank you for using the Calculator.
In: Computer Science
In: Operations Management
Scenario: You have been hired as an IT consultant by an entrepreneur starting a small advertising company called MilleniAds. As a start-up, your client’s company is relatively small and has a limited budget. There are only 10 employees, including a few creative directors, graphic designers, sales staff, a financial accountant, and an office administrator, with the entrepreneur acting as CEO. The current IT budget cannot exceed $25,000 and ideally should come in as far under that number as possible. MilleniAds will produce customized sales flyers, brochures, and other branded items, such as letterhead and business cards, that apply a youthful, fresh perspective targeting millennial demographics. Therefore, the company needs the ability to store and manipulate digital images and to produce physical copies of their products for their clients. The CEO wants to keep track of inventory, sales, and expenses digitally, but she does not anticipate having very complex records for the first year. She projects having only a dozen or so accounts but hopes to scale up in the coming years. It would be ideal to have a simple and user-friendly system for sharing information and files between employees. Many of the employees are millennials themselves who have indicated that their current desktop PCs are limiting their capabilities and that they prefer using their phones and other mobile devices for their professional and personal responsibilities. Two of the 10 employees will operate primarily outside of the office, soliciting business from regional firms, and they will need to access company information while on the road, in their home offices, and at customer sites. Beyond the specific information given above, you have the ability to fill in the gaps with assumptions or additional details that will make your final project unique and meaningful to you. If you have any questions, reach out to your instructor for guidance.
II. Hardware Components A. Examine the business’s issues to determine specific hardware requirements. Based on these issues, what are the major categories and components of hardware that should be considered? Identify each of the applicable requirements (hard drive storage, video cards, etc.), being sure to cite specific examples wherever appropriate. B. Then, compare and contrast the various options for meeting the requirements. Be sure to cite specific evidence from the component specification fact sheets to support your evaluation. What are their functional strengths and weaknesses? How do they compare in terms of cost and maintainability? C. Compose a final list detailing all of your specific hardware recommendations for your client. Be sure to logically justify your proposal as the best possible choice for meeting the business requirements.
In: Computer Science
A single-phase transformer 5 kVA, operating at 50 Hz frequency has turns ratio of 20. The primary and the secondary winding resistances are 0.15 Ω and 0.025 Ω respectively, and the primary and secondary leakage reactances are 0.65 Ω and 0.15 Ω respectively. The magnetizing inductance and core loss resistance are 6 Ω and 1 Ω respectively.
i. Calculate the primary and secondary impedances referred to primary and sketch the APPROXIMATE equivalent circuit. (Note: please show all parameters in the circuit)
ii. Hence, by referring to primary equivalent circuit, determine the supply voltage and its phase angle if output terminal is connected to a load ZL= 14∠20° Ω and load voltage, V2 is 240∠0° Vrms.
determine the voltage regulation and efficiency when core loss is equal to 100 W.
In: Electrical Engineering
Cusic Music Company is considering the sale of a new sound board used in recording studios. The new board would sell for $24,300, and the company expects to sell 1,600 per year. The company currently sells 1,950 units of its existing model per year. If the new model is introduced, sales of the existing model will fall to 1,620 units per year. The old board retails for $22,700. Variable costs are 55 percent of sales, depreciation on the equipment to produce the new board will be $1,275,000 per year, and fixed costs are $3,150,000 per year. If the tax rate is 25 percent, what is the annual OCF for the project?
In: Finance
Please use java language in an easy way and comment as much as you can! Thanks
(Write a code question) Write a generic method called "findMin" that takes an array of String objects as a parameter. (Use proper syntax, so that no type checking warnings are generated by the compiler.) The method should search the array and return the index of the smallest value.
In: Computer Science
a) Write a function drawShape() that accepts a parameter n, and:
b) What is the time complexity of the drawShape() function you created?
C++ language with for loop
In: Computer Science
Create a class called College that has:
Write two unsorted lists that manage the data for colleges and their ranking:
Each college will have a unique ID number that will be used for search.
For the lab you don't need to read the commands from a file. Your commands will be hard-coded as function calls within your main() function.
The following actions will be performed twice: once with the array and once with the linked list. Make sure your code is clearly marked with comments, so the grader can easily see which actions were performed with each structure.
C++language
In: Computer Science
Define and give examples of the four types of organizational culture found in MNC’s (family culture, Eiffel tower culture, guided missile culture and incubator culture). Include advantages/disadvantages of each.
Thank you!
In: Operations Management
Suppose that f(t) is the unique solution to the IVP y' = t + y^2 , y(0) = 5 and g(t) is the unique solution to the IVP y' = 1/(y + t^2) , y(5) = 0.
a. Determine an IVP that the function y = f(g(t)) solves. [Hint: You differential equation part will contain the functions t, g(t), and y in its expression.
b. (2 points) Show that the function y = t also solves this IVP.
c. (2 points) Use the uniqueness part of the Existence & Uniqueness Theorem to conclude that f and g are inverses.
In: Advanced Math
In: Computer Science
Adams Airline Company is considering expanding its territory. The company has the opportunity to purchase one of two different used airplanes. The first airplane is expected to cost $14,790,000; it will enable the company to increase its annual cash inflow by $5,100,000 per year. The plane is expected to have a useful life of five years and no salvage value. The second plane costs $34,400,000; it will enable the company to increase annual cash flow by $8,600,000 per year. This plane has an eight-year useful life and a zero salvage value. Required Determine the payback period for each investment alternative and identify the alternative Adams should accept if the decision is based on the payback approach. (Round your answers to 1 decimal place.)
In: Accounting
5. FA monomers indirectly interact via covalent bonds with other molecules to form lipid/fat polymers. Explain what this means, and why an additional molecule must be involved. Also describe the interaction that does occurs between FA tails, and why this interaction occurs; compare these interactions in saturated and unsaturated FAs.
In: Biology
In: Accounting
I found that sociobiologists suggest that this is nature’s way of successfully preserving the altruistic gene as this is a well adapted characteristic (Leak & Christopher, 1982). How can selfless behavior be deemed a strong adaptation if the species are more concerned with taking care of others over their own well being?
In: Psychology