![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Perform Structures in C Program
Create a structure called Person that contains the following data:
- string firstName
- string lastName
- int age
An initial code is provided for you. Don't edit anything in the main(), just create the structure directly.
Output
First name: Sample name
Last name: Sample name
Age: 2
![1. Structures Practice I
by CodeChum Admin
Create a structure called Person that contains the following
data:
• string firstName
• string lastName
• int age
An initial code is provided for you. Don't edit anything in the
main(), just create the structure directly.
Output
First name: Sample name
Last name: Sample name
Age: 2
main.c
1
#include <stdio.h>
2 #include <string.h>
3
4
5
6
7
M
8
9
10
11
12
13
14
15
16
int main(void) {
}
struct Person person1;
strcpy(person1.firstName, "Cody");
strcpy(person1.lastName, "Chum");
person1.age = 3;
> +16
printf("First name: %s\n", personl.firstName);
printf("Last name: %s\n", person1.lastName);
printf("Age: %d", person1.age);
return 0;
+ с
Test Cases
Run Tests
Constraints
O Constraint 1
This code must use a Person struct.
Test Cases
O Test Case 1 Hidden](https://content.bartleby.com/qna-images/question/47d062c1-c957-4532-a26c-3b51af227978/11998fd0-a812-4832-8806-238ff8e08025/t59so9g_thumbnail.jpeg)
Transcribed Image Text:1. Structures Practice I
by CodeChum Admin
Create a structure called Person that contains the following
data:
• string firstName
• string lastName
• int age
An initial code is provided for you. Don't edit anything in the
main(), just create the structure directly.
Output
First name: Sample name
Last name: Sample name
Age: 2
main.c
1
#include <stdio.h>
2 #include <string.h>
3
4
5
6
7
M
8
9
10
11
12
13
14
15
16
int main(void) {
}
struct Person person1;
strcpy(person1.firstName, "Cody");
strcpy(person1.lastName, "Chum");
person1.age = 3;
> +16
printf("First name: %s\n", personl.firstName);
printf("Last name: %s\n", person1.lastName);
printf("Age: %d", person1.age);
return 0;
+ с
Test Cases
Run Tests
Constraints
O Constraint 1
This code must use a Person struct.
Test Cases
O Test Case 1 Hidden
Expert Solution
![Check Mark](/static/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 3 images
![Blurred answer](/static/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- C++ reverse string allow the user to enter a string, display the results short codearrow_forwardPEN and PAPER Debugging the Pseudocode. Hand write the correct pseudocode using pen and paper. for DEBUG03-02.txt: // This pseudocode is intended to display employee net pay values.// All employees have a standard $45 deduction from their checks.// If an employee does not earn enough to cover the deduction,// an error message is displayed.start Declarations string name num hours num rate string DEDUCTION = 45 string EOFNAME = "ZZZ" num gross num net output "Enter first name or ", EOFNAME, " to quit" input name if name not equal to EOFNAME output "Enter hours worked for ", name input hours output "Enter hourly rate for ", name input rate gross = hours * rate net = gross - DEDUCTION while net > 0 then output "Net pay for ", name, " is ", net else output "Deductions not covered. Net is 0." endwhile output "Enter next name or ", EOFNAME, " to quit" input name endif…arrow_forwardC++ Languagearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education