use c language
1. If you defined a struct type total_sales with two members: clerkID and total_sales, and you initialized a variable called clerk1. How would you add
799.99 dollars to the total_sales member?(one statement)
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clerk1.total_sales=799.99;
Kindly revert for any queries
Thanks.
use c language 1. If you defined a struct type total_sales with two members: clerkID and...
Please use C++ Chapter 9 defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same components as the struct studentType, and add member functions to manipulate the data members. (Note that the data members of the class studentType must be private.) Write a program to illustrate how to use the class studentType. Struct studentType: struct studentType { string firstName; string lastName; char courseGrade; int testScore; int programmingScore; double GPA; }; An...
chapter 9 defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same components as the struct studentType,and add member functions to manipulate the data members. (Note that the data members of the class studentType must be private.) Write a program to illustrate how to use the class studentType.
Write code to accomplish each of the following:Define a structure called Dove containing int variable dovNo and char array dovArr with values that may be as long as 25 characters (including the terminating null character).Define dove to be a synonym for the type struct Dove.Use Dove to declare variable a to be of type struct Dove, array b[ 10 ] to be of type struct Dove and variable ptr to be of type pointer to struct Dove.Read a dovNo and a dovArr from the keyboard into the individual members of variable a.Assign the member values of variable a to element 3 of array b.Assign the address...
Create a structure called employee that contains two members: an employee number (type int) and the employee’s compensation (in dollars; type float). Ask the user to fill in this data for three employees, store it in three variables of type struct employee, and then display the information for each employee.
Suppose we have a struct type IntPair with members int smaller and int bigger. Implement the function IntPair getSmallestAndBiggest(int nums[], int length); that returns an IntPair with the smallest value of nums in member smaller and the biggest value of nums in the member bigger. Note: If length is 1 and more generally if all the elements of nums have the same value then smaller and bigger will be equal. (You may assume that length ≥ 1.)
In this exercise, you will make a struct that contains x and y coordinates: struct point {int x; int y;}; The object of this exercise is to make a singly linked list of these point structures. Add one more member called "next" to your point struct. It is a pointer to the next member of the linked list. The next member of the last point struct should point to NULL, which indicates the end of the list. Your program will...
C
Language
Write the code that dynamically allocates an array of struct objects based on a size entered through the command line arguments, You will use the following struct and enum. typedef enum Color { RED, GREEN, BLUE } Color; typedef struct MyStruct { int value; Color color; } MyStruct; Write the code to do the following: a. Check for one additional command line argument. Only proceed to the rest of the program if it exists and that the value...
Using C++: 1. Array and Struct in Card applications: In card game design, card suit and face values can be defined with enumeration values. Declare suit values - – hearts, clubs, diamonds, spades using enum, declare face values of 2 – 10, Jack, Queen, King, Ace using enum Declare a structure called Card, and it includes two data members, whose data types are the above two defined enumerations suit and face typedef an array called Deck, and it includes all...
Question on struct Write a struct called Song. Song will have the data members string title, string artist, int yearRecorded, string genre, int lengthMin, and int lengthSec. This struct will have object-values song1, song2, song3, song4, song5, song6, song7 and song8. Add your code for the struct Song to the following code. Then test that it runs, what exactly is printed when it is run? void printSong(Song); int main() { song1.title = "YYZ"; song1.artist = "Rush"; song1.yearRecorded = 1981; song1.genre...
C language not C++
1. Write the statements to do the following: (2 pts) a. Define a struct with member variables width, height, topleft x, topleft y all floats). Use a tag to call it Rectangle. b. Declare a variable struct type Rectangle 2. Consider the following variables: struct int x; float y; char zi var1; union nt x; float y; char[20] z;) var2 f float and int are stored using 4 bytes each, what is the size (in bytes)...