#include<stdio.h>
struct Customers{ //structure for customers of bank
char name[50];
int accNo;
float balance;
};
int main(){
struct Customers cust[5]; //5 customers are created
int i;
for(i=0; i<5; i++){
printf("\nEnter data for customer %d", (i+1));
printf("Enter name: ");
scanf("%s", cust[i].name); //input name
printf("Enter acc no: ");
scanf("%d", &cust[i].accNo); //input account number
printf("Enter balance: ");
scanf("%f", &cust[i].balance); //input balance
}
for(i=0; i<5; i++){
printf("\ncustomer %d", (i+1)); //display all details
printf("\n\tName: %s", cust[i].name);
printf("\n\tAcc no: %d", cust[i].accNo);
printf("\n\tBalance: %f", cust[i].balance);
}
return 0;
}
PROGRAM
Create a structure to specify data of5 customers in a bank. The data to be stored...
Create a function john, accepts a structure of type employee and return the same structure. Ask the user using printf and scanf to enter employee information (name, id and salary). You might use fgets for name, as scanf can not be used for strings with spaces. In main: Declare a structure of type employee Call function john and pass the structure. Display using prinf employee structure information returned from function john.
Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of 100 accounts. Use an array of pointers to objects for this. However, your...
In C++ Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e., debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction (i.e., credit or debit). Create an inheritance hierarchy containing base class Account and derived...
Create a program SearchNewBooks.cc that given as command line input newbooks.dat and request.dat and a method of search either binary or linear, creates a file of the number of books found from the request list. program should receive two filenames as command line arguments, the new books file and request file, which the program should read in. The list of new books and list of requested books should should be stored in only two std::vector containers. Because some code to...
Write a program that uses a structure to store the following data about a customer account: Name Address City, state, and ZIP Telephone number Account Balance Date of last payment The program should use an vector of at least 20 structures. It should let the user enter data into the vector, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Input Validation: When the data for...
*** C++ *** Create a class called Student that contains a first name ( string) and an student id number (type long). 1. Include a member function called get_data( ) to get data from the user for insertion into the object, 2. Also include a function called display_data( ) that displays the student data. Then write a complete program that uses the class to do some computation. Your main function, main( ), should create a Dynamic Array of...
Create the program in C++ please.
The new operator as outlined in
10.9
. Create a Test class that includes the following Data members • First Name, last name, test1, test2, test3 o Methods • Accessor methods for each of the data members' • Mutator methods for each of the data members . A Default Constructor . A constructor that will accept arguments for each of the 5 data members • A method that will calculate the average of the...
Write a program that keeps track of a speakers’ bureau. The program should use a structure to store the following data about a speaker: (this is in C++) Name Telephone Number Speaking Topic Fee Required The program should use a vector of structures. It should let the user enter data into the vector, change the contents of any element, and display all the data stored in the vector. The program should have a menu-driven user interface. Input Validation: When the...
Programming Instructions:Using Java Object Oriented Principles, write a program which produces the code as indicated in the following specifications: Your program must be a console application that provides a user this exact menu:Please select one of the following:1: Add Client to Bank2: Display Clients in the Bank3: Set Bank Name4: Search for a Client5: Exit Enter your Selection: <keyboard input here> The menu must be displayed repeatedly until 5...
Write a Python program to create userids: You work for a small company that keeps the following information about its clients: • first name • last name • a user code assigned by your company. The information is stored in a file clients.txt with the information for each client on one line (last name first), with commas between the parts. In the clients.txt file is: Jones, Sally,00345 Lin,Nenya,00548 Fule,A,00000 Your job is to create a program assign usernames for a...