Question

The question is about C Program. The program should provide users with the ability to create...

The question is about C Program.

The program should provide users with the ability to create an account. An account should be a structure type variable containing: a username, a password.

Please try to avoid using global printers and write in C.

Thank you very much!

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

Thanks for the question, here is the simple program in C. The program defines a struct Account, having two char array for username and for password.

The main program ask user to enter username, password, which are updated in an object of Account struct. The program then echos the details and prints a success message.

This is what the question ask for, i have not used any global variables in the program. In case anything else is needed please do comment and I will update the code, no need to post another quesiton for this.

==================================================================

#include<stdio.h>

typedef struct account{

               

                char username[50];

                char password[50];

} Account ;

int main(){

               

                char value[50];

                Account anAccount;

                printf("Enter your username: ");

                scanf("%49s",&anAccount.username);

               

                printf("Enter password: ");

                scanf("%49s",&anAccount.password);

               

                printf("\nDetails: \nUsername: %s \nPassword: %s\n",anAccount.username, anAccount.password);

                printf("\nAccount created successfully!");

}

==================================================================

Add a comment
Know the answer?
Add Answer to:
The question is about C Program. The program should provide users with the ability to create...
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
  • The question is about C Programming. Can you give me an example in c, the requirements...

    The question is about C Programming. Can you give me an example in c, the requirements are: The program need to provide users with the ability to create an account. An account should be a structure type variable containing: a username, a password. Please provide more explains about some steps, and write in C. Thank you!

  • Good evening, here is a C program question. I wanna to write a very small game....

    Good evening, here is a C program question. I wanna to write a very small game. The rule of the game is like rock scissors. Both of the player and the computer generate a letter taking the value A, B, C. And A<B, B<C, C<A (Like rock scissors game, rock<cloth, cloth< scissor, scissor<rock) Requirement 1: New users need to register an account with a username and password. Actually, the account should be a structure type variable containing: a username, a...

  • ATM MACHINE

    Kindly help me In this assignment you will create a RMI based system that allows a user to do the following: 1) Create a bank account by supplying a user id and password. 2) Login using their id and password. 3) Quit the program. Main Manu of ATM service window *Separate remote methods will be created for all of these functionalities. ->To create account see output below Hi! Welcome to  ATM Machine! Please select an option from the menu below: l -> Loginc -> Create New Account q -> Quit > c...

  • need help with c++ project: For the project. Create a c++ program about bus booking and...

    need help with c++ project: For the project. Create a c++ program about bus booking and ticketing system that - This system also needs you to key in your username and password precisely and ask again to confirm your booking of the bus ticket, and output of the ticket fully displayed -Must include selections, looping and functions, and array. - minimum of 6 functions including main function Keywords that should not be in the source code: class, struct, fstream, ifstream,...

  • I am creating a program that will allow users to sign in with a username and...

    I am creating a program that will allow users to sign in with a username and password. Their information is saved in a text file. The information in the text file is saved as such: Username Password I have created a method that will take the text file and convert into an array list. Once the username and password is found, it will be removed from the arraylist and will give the user an opportunity to sign in with a...

  • Algorithm Question: Please do not write a real program. The answer should be an explaination of...

    Algorithm Question: Please do not write a real program. The answer should be an explaination of your algorithm or pseudocode. Try to answer clearly and concisely. Thank you very much. Question: We are given a binary tree with height larger than h. Give an algorithm that finds a subtree of height h and among such tree, it returns the one with least number of elements.

  • I'm just a beginner in programming,how to make this program more simple without using #include<iostream> and #include<redex> here is the question Terms to know: If-else statement,for.....

    I'm just a beginner in programming,how to make this program more simple without using #include<iostream> and #include<redex> here is the question Terms to know: If-else statement,for..while..do while,loops,pointer,address,continue,return,break. Create a C++ program which contain a function to ask user to enter user ID and password. The passwordmust contain at least 6 alphanumeric characters, 1 of the symbols !.@,#,$,%,^,&,* and 1 capital letter.The maximum allowable password is 20. Save the information. Test the program by entering the User ID and password. The...

  • Please create a program answering the following question. In C PROGRAMMING! Contactlnformation Create a program with...

    Please create a program answering the following question. In C PROGRAMMING! Contactlnformation Create a program with the following requirements 1. You must have a data structure for personal contact information 2. Declare one of your contact information data structures locally in main 3. Create a function that allows users to enter in all of the information that populates the data structure that was passed in 4. Create a function that displays the information that was entered into the data structure...

  • Usage Usage: sna inputFile userName outputFile Requirements Summary Create a program that will re...

    Usage Usage: sna inputFile userName outputFile Requirements Summary Create a program that will read in the text file containing graph specification of Twitter account followers and write to the output a list of all users within a depth of 3 of the specified root user (the user specified from the userName command line argument), that are not already being followed by that user. The program should be able to create the directed graph from the input file and output the...

  • Write a C++ program using structures which create a structure called 'student' (structure should have name,...

    Write a C++ program using structures which create a structure called 'student' (structure should have name, age, major and grade) then create 4 instances of student and initialize accordingly. Contents of all 4 instances of student must be unique. Chose Data type for variables inside structure accordingly such that they are meaningful.

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