Question

In: Computer Science

Create a struct for the following groups of data: (a) Product Data with the following members...

Create a struct for the following groups of data: (a) Product Data with the following members • ID • Name • Price • Quantity (b) Customer Data with the following members • ID • Name • Address • E-mail (c) Sales Data with the following members • Customer ID • Product IDs • Sale amount • Choose the types that you think will work best for the above descriptions. • Names should have a maximum size of 50. • Physical addresses should have a maximum size of 100. • E-mail addresses should have a maximum size of 40. • Save your file as prob1.h.

Solutions

Expert Solution

Given:- Create structures for the following group of data?

- following are the all structure is present in a simple way if you have

any question or suggestion comment it below.

a) product data with the following members...

b)  Customer Data with the following members...

c)Sales Data with the following members...

struct ProductData
{
    int ID;
    char Name[50];
    float Price;
    int Quantity;
};

struct  CustomerData
{
    int ID;
    char name[50],Address[100];
    string Email;

};


struct  SalesData
{
    long  ID,ProductID;
    long salseamount;
    char name[50],Address[100];
    string Email[40];

};
 

a) product data with the following members...

struct ProductData
{
    int ID;
    char Name[50];
    float Price;
    int Quantity;
};

b)  Customer Data with the following members...

struct  CustomerData
{
    int ID;
    char name[50],Address[100];
    string Email;

};

c)Sales Data with the following members...

struct  SalesData
{
    long  ID,ProductID;
    long salseamount;
    char name[50],Address[100];
    string Email[40];

};

Related Solutions

Create a structure in C called BarcelonaPlayer with the following members. struct BarcelonaPlayer { char name[20];...
Create a structure in C called BarcelonaPlayer with the following members. struct BarcelonaPlayer { char name[20]; int age; char country[20]; char Position[20]; double Salary; double Rating; }; First, create an array of BarcelonaPlayer structures. Now, write a function that takes an array of BarcelonaPlayer structures as input and find out the highest paid player among all the players. void highestPaidPlayer(struct BarcelonaPlayer *pl, int size); Create another function that finds all the players from Argentina. void findPlayers(struct BarcelonaPlayer *pl, int size);
Create a typedef fruitType using the struct fruitType_struct to store the following data about a fruit:...
Create a typedef fruitType using the struct fruitType_struct to store the following data about a fruit: name (string, up to 50 characters long) color (string, up to 10 characters long) fat (integer) sugar (integer) carbohydrate (integer) Write a void function called printFruit that takes a fruitType parameter and prints the data (as shown in the example below). Declare a variable of type fruitType to store the following data: name: banana color: yellow fat: 1 sugar: 15 carbohydrate: 22 then use...
C++ Build a struct with many data members inside (for example, a large array). Design any...
C++ Build a struct with many data members inside (for example, a large array). Design any function that processes the data inside the struct (e.g. adding a few values together and returning the sum.) Write two versions of this function, one that passes by value and one that passes a const reference. Measure the time required to call each function 10,000 times.
Using the following definitions for a binary tree, typedef struct bintreenode {     int data;     struct bintreenode*...
Using the following definitions for a binary tree, typedef struct bintreenode {     int data;     struct bintreenode* left;     struct bintreenode* right; } btreenode; // Used for a node in the queue. typedef struct node {     btreenode* nodePtr;     struct node* next; } node; // Used to represent the queue efficiently. typedef struct queue {     node* front;     node* back; } queue; Implement the following functions: void bfs(btreenode* root) // Prints a breadth first search traversal of the binary search tree rooted at root....
Create a class called Car (Car.java). It should have the following private data members: • String...
Create a class called Car (Car.java). It should have the following private data members: • String make • String model • int year Provide the following methods: • default constructor (set make and model to an empty string, and set year to 0) • non-default constructor Car(String make, String model, int year) • getters and setters for the three data members • method print() prints the Car object’s information, formatted as follows: Make: Toyota Model: 4Runner Year: 2010 public class...
Create a class called Car (Car.java). It should have the following private data members: • String...
Create a class called Car (Car.java). It should have the following private data members: • String make • String model • int year Provide the following methods: • default constructor (set make and model to an empty string, and set year to 0) • non-default constructor Car(String make, String model, int year) • getters and setters for the three data members • method print() prints the Car object’s information, formatted as follows: Make: Toyota Model: 4Runner Year: 2010 public class...
There are several discrete groups of hominins, and that members of these groups originate at approximately...
There are several discrete groups of hominins, and that members of these groups originate at approximately the same time. For example, P. aethiopicus, A. africanus, A. garhi, and H. rudolphenis all are contemporaries that originated approximately 2.5 MYA. Develop a hypothesis to explain this pattern. [Hint: other taxonomic groups in the same region may have similar patterns.
QUESTION 60 Given the following Product structure: struct Product {     string name;     double price;...
QUESTION 60 Given the following Product structure: struct Product {     string name;     double price;     int quantity;     bool equals(const Product&); }; how would you define the equals function so two products are equal if their names and prices are equal? a. bool equals(const Product& to_compare) {     return (name == to_compare.name && price == to_compare.price); } b. bool Product::equals(const Product& to_compare) {     return (name == to_compare.name || price == to_compare.price); } c. bool equals(const Product& to_compare)...
Write in C++ language. (Employee Record): Create a class named 'Staff' having the following members: Data...
Write in C++ language. (Employee Record): Create a class named 'Staff' having the following members: Data members - Id – Name - Phone number – Address - AgeIt also has a function named 'printSalary' which prints the salary of the staff.Two classes 'Employee' and 'Officer' inherits the 'Staff' class. The 'Employee' and 'Officer' classes have data members 'Top Skill' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a officer by making an...
Please do this code with python. Thank you! struct Node {     int data;     struct...
Please do this code with python. Thank you! struct Node {     int data;     struct Node* left;     struct Node* right; }; // Node creation struct Node* newNode(int data) {     struct Node* nn         = new Node;     nn->data = data;     nn->left = NULL;     nn->right = NULL;     return nn; } // Function to insert data in BST struct Node* insert(struct Node* root, int data) {   if (root == NULL)         return newNode(data);     else {...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT