Question

In C++ Given the declarations struct SupplierType { int idNumber; string name; }; struct PartType {...

In C++

Given the declarations

struct SupplierType

{

int idNumber;

string name;

};

struct PartType

{

string partName;

SupplierType supplier;

};

PartType partsList[10000];

Write an output statement that prints the id of the supplier of the tenth part.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output statement that prints the id of

the supplier of the tenth part is below

cout<<partsList[10].supplier.idNumber;

Add a comment
Know the answer?
Add Answer to:
In C++ Given the declarations struct SupplierType { int idNumber; string name; }; struct PartType {...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following statements: struct nameType { string first; string last; }; struct courseType { string...

    Consider the following statements: struct nameType { string first; string last; }; struct courseType { string name; int callNum; int credits; char grade; }; struct studentType { nameType name; double gpa; courseType course; }; studentType student; studentType classList[100]; courseType course; nameType name; Mark the following statements as valid or invalid. If a statement is invalid, explain why. student.course.callNum = "CSC230"; cin >> student.name; classList[0] = name; classList[1].gpa = 3.45; name = classList[15].name; student.name = name; cout << classList[10] << endl;...

  • CREDITUU NAME: (8) Given the following declarations: int *pt: int size; a) Write the one statement...

    CREDITUU NAME: (8) Given the following declarations: int *pt: int size; a) Write the one statement that will dynamically allocate an integer array of size size WHICH YOU WILL WRITE TO GET USER INPUT FROM THE CONSOLE using the declarations above. b) Write the one statement that would delete the dynamically allocated array.

  • 13. Given the following structure struct node { struct node *next; int id; }; Write a...

    13. Given the following structure struct node { struct node *next; int id; }; Write a code to insert a new node into the linked list as the last node of the linked list struct node *insertLast(stuct node **head, int newId) { } 14. Given the following structure struct node { struct node *next; int id; }; Write a code to insert a new node into the linked list after a node with the same id as the input parameter...

  • Suppose the following declarations appear in the mainfunction of a C++ program: string name, qualification; char...

    Suppose the following declarations appear in the mainfunction of a C++ program: string name, qualification; char sex; int age, yearsExperience; If the following function header is given: void findCandidate (char sex, int & agep, string & name, int yearsExperience, string qualification) which of the options below is a correct calling statement of the function findCandidate in the main function? 1. findCandidate('m', 30, nameP, 7, "B. Curr"); 2. findCandidate (sex, age, name, yearsExperience, qualification); 3. findCandidate ('m', 30, name, 7, qualification);...

  • Answer it by using c++ context. struct courseType struct studentType { { struct name Type {...

    Answer it by using c++ context. struct courseType struct studentType { { struct name Type { string first; string last; }; string name; int callNum; int credits; char grade; name Type name; double gpa; courseType course; }; student Type student; student Type classList[100]; course Type course; nameType name; Mark the following statements as valid or invalid. If a statement is invalid, explain why. a. student.name.last="Anderson"; b. classList[1].name = student; c. student.name = classList[10].name;

  • #include <iostream> #include<string> #include<vector> using namespace std; struct patient { string name; char Gender; int d,m,y;...

    #include <iostream> #include<string> #include<vector> using namespace std; struct patient { string name; char Gender; int d,m,y; string nationality; int civilID; int phoneNumber; string TypeOfInsurance; }; Activities I. Declare a variable from the struct Patient called pat. II. Fill out the information of pat by reading them from the input. III. Declare a pointer of type Patient called pat_ptr and assign the address of pat to it. IV. Change the value of name field of pat by accessing it through pat_ptr....

  • struct Item { string name; int quantity; float cost; }; const int MAX_SIZE = 50; class...

    struct Item { string name; int quantity; float cost; }; const int MAX_SIZE = 50; class ManageInventory { public: ManageInventory() : count{0}, p_pInventoryItems {new Item*[size]} { } ManageInventory(int size) : size{size}, count{0}, p_pInventoryItems {new Item*[size]} { } ~ManageInventory(); void addItem(string name, int quantity, float cost); private: int size {MAX_SIZE}; int count; Item ** p_pInventoryItems; }; Write the definition for addItem. Use the new operator to dynamically create instances of type Item. Store pointers to inventory items in the inventoryItems array....

  • Write the functions needed to complete the following program as described in the comments. Use the...

    Write the functions needed to complete the following program as described in the comments. Use the input file course.txt and change the mark of student number 54812 to 80. /* File: course.cpp A student's mark in a certain course is stored as a structure (struct student as defined below) consisting of first and last name, student id and mark in the course.  The functions read() and write() are defined for the structure student.   Information about a course is stored as a...

  • Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; };...

    Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; }; void func(struct student stud); int main() { struct student astud; astud.id=9401; strcpy(astud.name, "Joe"); astud.grade = 'A'; func(astud); return 0; } Abdelghani Bellaachia, CSCI 1121 Page: 16 void func(struct student astud) { printf(" Id is: %d \n", astud.id); printf(" Name is: %s \n", astud.name); printf(" Grade is: %c \n", astud.grade); } Modify this program to include the address of a student as a separate structure....

  • struct nameType { string first; string last; }; struct studentType { nameType name; double gpa; };...

    struct nameType { string first; string last; }; struct studentType { nameType name; double gpa; }; a. Write a program that declares an array of the studentType structure, size 10, name of your choice, and includes the following: • Write a void function to request user input into each of the members of the studentType structure array. Be sure to include proper user prompts. Assume the entire structure array is filled. Write the prototype and the function definition. • Call...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT