Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the pseudocode of the a function, addRecord, to add a record to a inked ist of records. Assume the following variables are already defined,

image text in transcribedimage text in transcribed

Write the pseudocode of the a function, addRecord, to add a record to a inked ist of records. Assume the following variables are already defined, initalized and available for you to use: . start: The pointer to the first record of the list (or NULL) .uaccountno: The user's account number (integer) uname: a character array containing the user's name uaddress: a character array containing the user's address Assume the following struct definition: struct record int accountno; name [251: address[80): struct record next 1. Write the pseudocode for the function addRecord with the following features: e must addinsert a new record into the list so that all records are sorted in ascending order by account number o It must not accept a duplicate account number. Instead, it must increament the new account number so all records have different numbers. e.g., when you are inserting "1001 to the ist of "1000, 1001, 1002, 1003, 1008, 1010", the result ll be "1000, 1001, 1002, 1003, 1004, 1008, 1010' where "1004" is the newly added one. 2. There must be no use of any C code (also no curly braces) in the pseudocode 3. You may ONLY use the vocabulary from the list below 4. The functioning code will be about 30 Iines. Pseudocode with more than 40 lines is not acceptable. Vocabulary list: replace the bold parts with your variables and expressions. 1. define variable_type called variable_name note: you can newly define ONLY these variable types e an int e a pointer to record example define an int called i define a pointer to record called tenp 2. allocate a heap space and store its address into variable_name note: varlable name must be a pointer to record. example allocate a heap space and store its address into temp Write the pseudocode of the a function, addRecord, to add a record to a inked ist of records. Assume the following variables are already defined, initalized and available for you to use: . start: The pointer to the first record of the list (or NULL) .uaccountno: The user's account number (integer) uname: a character array containing the user's name uaddress: a character array containing the user's address Assume the following struct definition: struct record int accountno; name [251: address[80): struct record next 1. Write the pseudocode for the function addRecord with the following features: e must addinsert a new record into the list so that all records are sorted in ascending order by account number o It must not accept a duplicate account number. Instead, it must increament the new account number so all records have different numbers. e.g., when you are inserting "1001 to the ist of "1000, 1001, 1002, 1003, 1008, 1010", the result ll be "1000, 1001, 1002, 1003, 1004, 1008, 1010' where "1004" is the newly added one. 2. There must be no use of any C code (also no curly braces) in the pseudocode 3. You may ONLY use the vocabulary from the list below 4. The functioning code will be about 30 Iines. Pseudocode with more than 40 lines is not acceptable. Vocabulary list: replace the bold parts with your variables and expressions. 1. define variable_type called variable_name note: you can newly define ONLY these variable types e an int e a pointer to record example define an int called i define a pointer to record called tenp 2. allocate a heap space and store its address into variable_name note: varlable name must be a pointer to record. example allocate a heap space and store its address into temp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions