Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C Language program. Program must be C. Please follow instructions given. Thank you. Problem 3(20 points)-Write a program Submit vote.c Simone works for

Create a C Language program. Program must be C. Please follow instructions given. Thank you.
image text in transcribed
image text in transcribed
image text in transcribed
Problem 3(20 points)-Write a program Submit vote.c Simone works for a group that wants to register more people to vote. She knows her team can only ask a certain number of people at any given time since they have other obligations. She has asked you to create a program for her team that allows the user to type in how many people they want to ask at one time (the duration of the current program run). The program will then ask that many people (see sample run). If a person answers y, his or her name is added to a registration list (a file) and the current registration list is output to screen. If they answer n, Ok is output to screen and the program continues. Once at least 10 people have been registered, whenever the program is opened the phrase Target Reached! Exiting... should be output to screen Step 1:You will be defining the following two functions (DO NOT MODIFYTHE DECLARATIONS): /This function takes a file pointer, goes through the file and prints the file contents to screen. It returns the number of lines in the file int registered(FILE *fp) /This function takes a file pointer and adds a new line to the file void new.register(FILE *fp) Step 2: Use the functions you defined to make a working program. computer$ gcc-o vote vote.c computerS/vote register.txt Registered so far:** How many people to ask right now? Person 1: Would you like to register to vote? Ok. Person 2: Would you like to register to vote? Enter name: Bill Gates Adding: Bill Gates Registered so far:** 1. Bill Gates Person 3: Would you like to register to vote? Enter name: Mark Zuckerberg Adding: Mark Zuckerberg Registered so far: 1. Bill Gates 2. Mark Zuckerberg 3 people asked! Taking a break. computer./vote register.txt Registered so far:** 1. Bill Gates 2. Mark Zuckerberg How many people to ask right now? Person 1: Would you like to register to vote? Ok. Person 2: Would you like to register to vote? Ok. Person 3: Would you like to register to vote? Enter name: Jeff Bezos Adding: Jeff Bezos Registered s o far:** 1. Bill Gates 2. Mark Zuckerberg 3. Jeff Bezos Person 4: Would you like to register to vote? Enter name: Susan Wojcicki Adding: Susan Wojcicki "Registered so far:** 1. Bill Gates 2. Mark Zuckerberg 3. Jeff Bezo:s 4. Susan Wojcicki 4 people asked! Taking a break

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions