Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Introduction: 

This assignment requires a knowledge of variables (integers, char types), loops, conditionals, switch, functions, char arrays, string arrays, number arrays, structs, character input and output, file I/O, string functions, static and function calls.   

The assignment:

Develop and submit an original implementation of a Data Storage System. The user will be presented with a login screen based on the solution to assignment 2. Once logged in, the user will be presented with a menu offering the following options:

New Application

View Applications

Delete Application

New User

New Application added functionality of data storage in a loan file. Assume that all data fields are compulsory. View Applications will present a numbered list of 1-line summaries of each stored application. Only the name and application date will be displayed. The user can select an application (by typing its number) to see the entire application.

Delete will display the same numbered list, but the application data will be deleted from the loan file if the user selects an entry.  New User will prompt for a user name and password.  The user name must not already be in use.  The new user name and password hash will be written to the passwd file.      

  • This assignment must be written in C and must compile and run on BA computer lab PCs using Quincy 2005 v1.3. Build options must include Strict ANSI/ISO compliance, C99 support and must compile with no warnings when the All Warnings option is selected.
  • Your code must have appropriate comments including your names and student numbers, the name of the .c file, the purpose of the program, brief explanations of variables and explanations of any code which is not obvious to another programmer.
  • All code can be placed in user-defined functions. The main function should only contain the opening menu system and relevant function calls.
  • Bonus marks (5% of the total mark for the assignment) will be awarded if the arrays of loan and applicant structs are allocated dynamically (using malloc(). The alternative (without the bonus marks) is to use conventional arrays of structs.

Hints:  

1. Adapt the code from assignment 2 to either give access to or deny access to the menu

2. Write a simple switch-based menu routine which calls functions (see the lecture on switch)

3. Store the sample loan information in a text file.  

4. Define a struct to hold the applicant information

5. Define a struct to hold the loan information

6. Create two arrays of structs - one of type Applicant, and one of type Loan

7. Create an int which holds the number of applications in the arrays (int no_elements = 0)

8. To read in the applications from file, 

  • declare a Loan and an Applicant variable
  • write a function which reads the first loan information into the Applicant and Loan structs
  • Add these structs to the relevant arrays (at index no_elements) and increment the no_elements variable for the arrays by 1
  • repeat until all of the test data has been read into the arrays.

9. Write a function to display the list of applications. 

  • Use a for loop to change the index from 0 to the number of elements.:
  • Use the . syntax to access each member of each array element
  • i.e. printf(.... , applicant[i].firstName, applicant[i].surname...)
  • Each application should be numbered

10. Write a function to display the contents of a pair of loan and applicant structs (after prompting for the index).   

11. Write a delete function which 

  • calls the display function
  • prompts for the element to be deleted
  • deletes it (see slide on deleting things from an array - array lecture)

12. Write a function to create a new application - this should use code from assignment to populate a pair of empty Applicant and Loan structs

13. Write a function to write the contents of the two struct arrays back to the file in the same format they were read. 

14. Write a function which changes a password - prompts for a user name and password, and writes the name and hashed password to the end of the password file (use "a" in fopen).

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9523770

Have any Question?


Related Questions in C/C++

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As