C++ PROGRAMMING: PROGRAM DESIGN INCLUDIN
8th Edition
ISBN: 9780357425312
Author: Malik
Publisher: Cengage
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 3PE
Program Plan Intro
Implementation of a
Program Plan:
Write a C++ program with a main function and the required set of statements to accomplish the following:
Create a structure menuItemType.
Declare the two components: menuItem of string type and menuPrice of double type.
Display the details of the structure in the main function.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Language is C++
C++
in phython language
Create a package folder named shapes. Inside this package, place two more package folders: 2d and 3d.
Inside 2d package, place a module file: circle.py
circle.py module has two function definitions: areaCircle(), circCircle(). areaCircle() function takes a parameter: radius, calculates and returns the area of the circle. You may assume PI is 3.14. circCircle() function also takes a parameter: radius, calculates and returns the circumference of the circle.
Inside 3d package, place two module files: sphere.py and cylindir.py
sphere.py module has two function definitions: areaSphere() and volumeSphere() which both take a parameter for radius, calculates and returns area and volume of a sphere respectively.
cylindir.py module has two function definitions: areaCylindir() and volumeCylindir() which both take two parameters: height and radius. They calculate area and volume of a cylindir and return the values respectively.
You may find the formulas for those shapes…
Chapter 9 Solutions
C++ PROGRAMMING: PROGRAM DESIGN INCLUDIN
Knowledge Booster
Similar questions
- algorithm and programming Program Use the language Carrow_forwardWhat does the function f do? struct Point2D { double x; double y; struct Triangle { Point2D v1; Point2D v2; Point2D v3; }; void f(Triangle&t) { } int temp = 12.5; temp = t.v1.x; t.v1.x = t.v1.y; t.v1.y = temp; } int main () { Triangle mytri; mytri.v1.x = 1.0; mytri.v1.y = 22.5; f (mytri); Swaps values of x and y in vertex 1 of an argument of type Triangle Initializes value of x in vertex 1 of an argument of type Triangle Sets all x,y values in all vertices of an argument of type Triangle Swaps value of x in vertex 1 with value of x in vertex 2, for an argument of typearrow_forwardComputer Science IN C++ Write a program that implements the game tic-tac-toe: Tic-Tac-Toe is a game played on a three-by-three board. Two players, X and O, alternate in placing their respective marks in the cells of this board, starting with player X. If either player succeeds in getting three of his or her marks in a row, column, or diagonal, then that player wins. In this homework, you should use the OOP concepts to implement the tic-tac-toe game.arrow_forward
- Code in c language, please. Thank you in advance. Assign listOfPizzas's first element's numberOfCalories with the value in listOfPizzas's second element's numberOfCalories. #include <stdio.h>#include <string.h> typedef struct Pizza_struct { char pizzaName[75]; int numberOfCalories;} Pizza; int main(void) { Pizza listOfPizzas[2]; scanf("%s", listOfPizzas[0].pizzaName); scanf("%d", &listOfPizzas[0].numberOfCalories); scanf("%s", listOfPizzas[1].pizzaName); scanf("%d", &listOfPizzas[1].numberOfCalories); /* Your code goes here */ printf("A %s slice contains %d calories.\n", listOfPizzas[0].pizzaName, listOfPizzas[0].numberOfCalories); printf("A %s slice contains %d calories.\n", listOfPizzas[1].pizzaName, listOfPizzas[1].numberOfCalories); return 0;}arrow_forwardPart 2. fill Method Define a method in simpy named fill. Its purpose is to fill a simpy's values with a specific number of repeating values. The fill method will have two parameters following self: 1. The float value you are filling the values list in with. 2. The int number of values to fill in. The fill method is procedure-like in that it returns None and mutates the object the method is called on. After calling fill, the length of the Simpy object's values should be equal to the second argument given to fill. For example, consider the following usage and expected printed output, given inline, below: twos = Simpy([]) twos.fill(2.0, 3) print("Actual: ", twos, Expected: Simpy([2.0, 2.0, 2.0])") twos.fill(2.0, 5) print("Actual: ", twos, " - Expected: Simpy([2.0, 2.0, 2.0, 2.0, 2.0])") mixed = Simpy([]) mixed.fill(3.0, 3) - Expected: Simpy([3.0, 3.0, 3.0])") print("Actual: ", mixed, mixed.fill(2.0, 2) print("Actual: ", mixed, Expected: Simpy ([2.0, 2.0])") Pythonarrow_forwardWhich type of data structure stack is it? A. Linear B. Non-Linear C. Nonconsecutive D. None of thesearrow_forward
- write the UMLclass diagram #include<iostream>#include<string> using namespace std; const int maxrow = 10; string ChickenriceQuantity[maxrow] = {};string ChickenriceType[maxrow] = {};string search(); class Chickenrice{ public: string ChickenriceQuantity[maxrow]; string ChickenriceType[maxrow]; void DisplayMenu(); void AddRecord(); void DeleteRecord(string search); void ShowRecord(string search); void DisplayAllRecord(); }; int main(){ std::cout<<"MENU\n"; int option; system("CLS"); Chickenrice rice; do{ cout<<"1-Display menu"< cout<<"2-Add details"< cout<<"3-Delete details"< cout<<"4-View all list of chicken rice"< cout<<"5-View selected chicken rice record"< cout<<"6-EXIT"< cout<<"Select OPTION"< cin>>option; switch(option) { case 1: { rice.DisplayMenu();…arrow_forwardIN C++ USING CLASS Write a program in C++ that implements the game tic-tac-toe: Tic-Tac-Toe is a game played on a three-by-three board. Two players, X and O, alternate in placing their respective marks in the cells of this board, starting with player X. If either player succeeds in getting three of his or her marks in a row, column, or diagonal, then that player wins. In this homework, you should use the OOP concepts to implement the tic-tac-toe gamearrow_forwardIn c++arrow_forward
- #include <iostream>using namespace std; class TurtleNode { public: TurtleNode(int babiesInit = 0, TurtleNode* nextLoc = nullptr); void InsertAfter(TurtleNode* nodeLoc); TurtleNode* GetNext(); void PrintNodeData(); private: int babiesVal; TurtleNode* nextNodePtr;}; TurtleNode::TurtleNode(int babiesInit, TurtleNode* nextLoc) { this->babiesVal = babiesInit; this->nextNodePtr = nextLoc;} void TurtleNode::InsertAfter(TurtleNode* nodeLoc) { TurtleNode* tmpNext = nullptr; tmpNext = this->nextNodePtr; this->nextNodePtr = nodeLoc; nodeLoc->nextNodePtr = tmpNext;} TurtleNode* TurtleNode::GetNext() { return this->nextNodePtr;} void TurtleNode::PrintNodeData() { cout << this->babiesVal << endl;} int main() { TurtleNode* headObj = nullptr; TurtleNode* firstTurtle = nullptr; TurtleNode* secondTurtle = nullptr; TurtleNode* currTurtle = nullptr; int babies1; int babies2; cin >> babies1; cin…arrow_forwardbootstrap class for form control is class="form-control-file" class="input-group-text" class="form-control"arrow_forwardobject oriented c++arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,