Question

Declare a struct worker with the following attributes: char array first name string surname int age...

Declare a struct worker with the following attributes:

char array first name

string surname

int age

double salary.

then , declare a structure my worker which is of type worker. ( read carefully, don,t make a mistake! ) one line is needed for the answer.

in c programming

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

main.c

#include <stdio.h>

struct worker {
char first_name[50];
char surname[50];
int age;
double salary;
}my_worker;

int main()
{

return 0;
}

Add a comment
Know the answer?
Add Answer to:
Declare a struct worker with the following attributes: char array first name string surname int age...
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
  • C programming The program will require the following structure: struct _data { char *name; long number;...

    C programming The program will require the following structure: struct _data { char *name; long number; }; The program will require command line arguments: int main(int argv, char **argc) { Where argv is the number of arguments and argc is an array holding the arguments (each is a string). Your program must catch any case where no command line arguement was provided and print a warning message (see below). You MUST include/use the following functions, defined as follows: int SCAN(FILE...

  • #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....

  • 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;...

  • struct my_coord { int x; int y; double altitude; }; struct my_line { struct my_coord first;...

    struct my_coord { int x; int y; double altitude; }; struct my_line { struct my_coord first; struct my_coord second; char name[10]; }; struct my_coord var; struct my_coord array[3]; struct my_line one_line; struct my_line two_lines[2]; Draw the memory layout of the prior four variables; var, array, one_line, and two_lines on a line of boxes. Label the start of each variable and clearly show how many bytes each element within each structure variable consumes.

  • 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....

  • 1. Define Structure UNIT as described in the list: ınit char codease complete the question int...

    1. Define Structure UNIT as described in the list: ınit char codease complete the question int numberOfCreditHours int semester int numberOfPreReq; pointer to number of pre-requisites eg:like char preRequisite[numberOfPreReq][10]; char* preReq int numberOfPostReq; pointer to number of post-requisites eg:like char postRequisite[numberOfPostReq] [1 0]; char* postReq NOTE: this is a BIG question and has to be asked seperately, answering only one question here. pluginfile.php/94428/mod resource/content/1/lab 6202 %20 %28file %20and%20parsing % 29.pdf Expected C++Skills to finish this activity Simple data types C++...

  • C++ Question 15 3.95 pts struct Person int age; char gender; double weight: string name; Person...

    C++ Question 15 3.95 pts struct Person int age; char gender; double weight: string name; Person p[35, 'M', 175.5, "Steve"); Which of the options below correctly represents how the structure object p is stored in memory? RAM (Memory) Address Value Address o Address 1 Address 2 Address 3 Address 4 Which of the options below correctly represents how the structure object p is stored in memory? B-) RAM (Memory) Address Value Address 0 Address 1 Address 2 Address 3 Address...

  • Consider the following methods’ headers: public static int one(int a, char b, double c, String d)...

    Consider the following methods’ headers: public static int one(int a, char b, double c, String d) public static double two(double x, double y) public static char three(int r, int s, char t, double u) Answer the following questions: Q1) What is the signature of method one? Answer: Q2) What is the return type of method two? Answer: Q3) What the formal parameters of method three? Answer: Q4) How many actual parameters are needed to call the method three? Answer: Q5)...

  • #include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; struct transition{ // transition structure...

    #include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; struct transition{ // transition structure char start_state, to_state; char symbol_read; }; void read_DFA(struct transition *t, char *f, int &final_states, int &transitions){ int i, j, count = 0; ifstream dfa_file; string line; stringstream ss; dfa_file.open("dfa.txt"); getline(dfa_file, line); // reading final states for(i = 0; i < line.length(); i++){ if(line[i] >= '0' && line[i] <= '9') f[count++] = line[i]; } final_states = count; // total number of final states // reading...

  • Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names,...

    Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names, and read in course names from an input file. Then do the output to show each course name that was read in. See Chapter 8 section on "C-Strings", and the section "Arrays of Strings and C-strings", which gives an example related to this lab. Declare the array for course names as a 2-D char array: char courseNames[10] [ 50]; -each row will be a...

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