C++ :: Program That Keeps Track Of Social Security Numbers Of Customers
Jun 27, 2013
I am trying to write a program that keeps track of social security numbers of customers I have to assume that its a four-digit number. When the program runs,it has to prompt that the user should enter a 4-digit number to record, or 0 to exit.
The program also needs to be able to give an error message if a certain number is entered more than once.
After all the numbers have been saved and you finally end it by pressing 0, it needs to be able to output all the entered SSN's.
Here is my code so far:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
bool isExist(int ssn, int records[], int numberOfRecords);
[Code] ......
View 3 Replies
ADVERTISEMENT
Oct 4, 2014
In this assignment, you are going to write a program that keeps track of the social security numbers (SSN) of customers of a bank. Please notice that we are going to assume that SSN is a four-digit number (e.g., 1234. 0123 is not allowed.). When the program runs, it prompts that the user should enter a 4-digit SSN number to record, or 0 (zero) to exit.
So far I have this:
#include <iostream>
using namespace std;
bool isExist(int ssn, int records[], int numberOfRecords);
int main(){
int ssn = 0;
int records[32];
[Code] .....
View 16 Replies
View Related
Jun 26, 2013
I am trying to write a program that keeps track of social security numbers (SSN) of customers of a bank. I have to assume that SSN is a four-digit number (e.g., 1234. 0123 is not allowed.). When the program runs,it has to prompt that the user should enter a 4-digit SSN number to record, or 0 (zero) to exit.
The program also needs to be able to give an error message if a certain number is entered more than once.
After all the numbers have been saved and you finally end it by pressing 0, it needs to be able to output all the entered SSN's.
Here is my code so far :
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
bool isExist(int ssn, int records[], int numberOfRecords);
void listRecords(int records[], int numberOfRecords);
int main()
[Code]...
View 2 Replies
View Related
Sep 14, 2014
My professor at college stated that it is important to always initialize a function type because if you don't it creates a security vulnerability. He said that it is better to initialize it as zero and then let the programmer/user manipulate that value later on.Why is this a security vulnerability within the program?Here was the example:
BAD:
int x;
GOOD:
int x = 0;
View 4 Replies
View Related
Oct 17, 2013
Create a line class using a linked list that acts as a queue (first in, first out) both enqueue and dequeue. Complete the line class so that customers can be added or removed from the line. Implement the line as a linked list of customer objects that you have developed yourself or use the vector class.
View 2 Replies
View Related
Aug 12, 2014
I'd like to make a control panel for different social media to control multiple account and have proxy support. I think i need to learn multithreading and socket programming right ?
View 1 Replies
View Related
Apr 4, 2015
I wrote the following code to divide 100 customers into three clusters but it kept on hanging during execution. I used while loop. Attached is the text file to use. and the code below :
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <cstdlib>
#include <ctime>
#include <stdio.h>
#include <math.h>
[Code] ....
Attached File(s)
c201.txt (7.13K)
View 1 Replies
View Related
Nov 8, 2013
//using bloodshed dev c++ compiler
//How can I output the name and a two digit number next to it
//example would be Indiana Jones 20
#include<iostream>
#include<string>
using namespace std;
class Customer {
[Code] .....
View 3 Replies
View Related
Apr 25, 2013
SYNOPSIS : KBJ tourist agency Sdn. Bhd wants you to write an application program to calculate the total price for their customers for a package of vacation. The following table shows the price for three destinations (transportation and accommodation) offered by the agency:
Destination TransportationAccommodation
Pulau Redang Child RM15.00
Adult RM30.00RM95 per day
Pulau Perhentian Child RM20.00
Adult RM30.00 RM100 per day
Pulau Kapas Child RM10.00
Adult RM20.00 RM120 per day
This agency company will give some discount to a group of customers with is:
a.10% discount will be given for the group that has a least 5 adults.
b.25% discount will be given for the group that has more than 5 persons (adults and children)
c.30% discount will be given for the group that has at least 15 persons.
Your application program has to display the output using this following screen layout:
KBJ TOURIST CUSTOMER INFORMATION
Customer’s name: XXXXXXXXXXXXX
Number of Children:XXXXX
Number of Adult: XXXXX
Transportation: RMXXX.XX
Accommodation: RMXXX.XX
Total price: RMXXXX.XX
This is the code i got so far but it doesn't work..:(
#include <iostream.h>
int main () {
char customerName,code,A,B,C;
int childNum,adultNum;
double rate,discount,totalPrice,a,c;
[Code] .....
View 8 Replies
View Related
Apr 10, 2013
I have to create a small data base for a shop. One of the functions i am creating is taking a customers ID and scanning that through a text file and to print out the info about that customer. What i am having trouble with is where do i insert the string compare in my program?
//declaring array for input of customer ID
int customer_ID [20];
printf("Please enter the customer ID:");
gets( customer_ID ); //users input stored in the array
[Code] .....
View 2 Replies
View Related
Feb 7, 2015
I am currently trying to read information from an ID3V1.1 tag in C. For this project we are not allowed to use any external libraries. All of the fields except for the track field read correctly. The last two lines are the ones giving me trouble. Whenever I run the program, I get a seg fault when it tries to get the track number. I tried to debug using gdb and it said the problem was happening on line 34 which is where the fseek is. It works for the other fields so I'm wondering why it is going wrong. Should I change the offset to something other than -128? But the whole tag is only 128 characters so I'm unsure what is going wrong.
Code:
Program received signal SIGSEGV,
Segmentation fault.0x00000034ff66edf1 in fseek() from / lib64 /
libc.so .6 Missing separate debuginfos,
use:debuginfo - install glibc - 2.12 - 1.132.el6_5 .3.x86_64(gdb) back
#0 0x00000034ff66edf1 in fseek () from /lib64/libc.so.6
#1 0x000000000040076f in main (argc=1, argv=0x7fffffffdf58) at id3tagEd.c:34 Code: Code: #include<stdio.h>
#include<string.h>
}
[code]...
View 2 Replies
View Related
Nov 19, 2013
I want to create an object that uses visual C#'s Numeric Up/Down and a Track bar.
The reason is that I have a GUI that uses lots of these linked together with events and I want a common event handler for all of them.
Maybe just adding a property that is a Numeric Up/Down in the Track bar and vice-versa will allow me to create a common event for all of these pairs.
View 1 Replies
View Related
Oct 1, 2014
i am trying to make a hangman game. The game works fine so far but i cannot seem to keep track of the letters used. I have to prevent the user from using a letter that has already been entered by the user at some point in the game before. But can't seem to work my way around it. I have included the code below
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<ctime>
[Code].....
View 3 Replies
View Related
Oct 14, 2013
does a pointer keep track of time stamps when it is created? i am trying to use it to create a table that can store the access count and the temporal locality at the same time.
View 5 Replies
View Related
Dec 11, 2013
[URL] ....
This is my code, but how can I implement this?
View 1 Replies
View Related
Feb 19, 2014
I would like to track user actions within my windows desktop application, and write them to a database.
I also have a User class, that has a userID field pulled from the User table. I can write a login event (UserID, timestamp, action) with no problem, but as the user navigates around the app, how can I persist the user object so I always have access to their userID? I know I can just pass it as a parameter as they do different tasks, but that seems inefficient to me.
View 7 Replies
View Related
May 4, 2013
I have a set of n- dimension point store in `vector< vector<double> >`
ex A[0][1].............[N], and A[0][0] = X, A[0][1] = Y, A[0][2] = Z
and I want to sort the vector of all of the dimension
ex sort X, Y, Z ,.........N in ascending order
ex A[0] = (1,5,3), A[1] = (3,2,1) A[2] = (2,8,4) after sorting
index: 0 1 2
A[0] = (1,5,3), A[1] = (2,8,4) A[2] = (3,2,1)
original index : 0 2 1
I find that `sort(vector.begin(), vector.end())` can sort it but how can I record the original index with a additional vector?
Is there a algorithm or C++ feature can solve it?
I have tried to solve it with a class wrapper it but I don't know how to write the compare function.
class point{
public:
point(int totalLength = 0, int elementLength = 0);
vector<vector<double> > pointSet;//store the n-D points
vector<double> pointIndex;//store the index
};
point::point(int totalLength, int elementLength){
pointSet.resize(totalLength,vector<double>(elementLength, 0));
pointIndex.resize(elementLength);
}
View 3 Replies
View Related
Sep 27, 2014
I wrote a code that mimics a dice, my code so far will ask for the user to input a number at which they want to hold or no longer throw the dice, it will also ask the user how many roll simulations they would like to do.
If a 1 is rolled the turn is over and the score is 0
After this input is recieved the code goes into a loop until the values have been met.
I would to add probability to my code so I need to know how many times a certain number was rolled and this is where I am stuck.
An example of how I would like my code to work, let's suppose hold at number is 17
We role the dice until we roll a 17 or larger, but if we roll a 1, then our score is 0.
Let's suppose the number of simulations is 5 and for simulation 1 we roll
2 + 5 + 6 + 4 = 17
and for simulation 2 we roll
5 + 4 + 1, but since we rolled a 1, the score is 0,
for simulation 3 we roll
3 + 4 + 5 + 6 = 18
for simulation 4 we roll
4 + 4 + 6 + 6 = 20
for simulation 5 we roll
3 + 4 + 5 + 5 = 17 so that means we got
0: 1 time 1/5 = .20
17: 2 times 2/5 = .40
18: 1 time 1/5 = .20
19: 0 times 0/5 = .00
20: 1 time 1/5 = .20
21: 0 times 0/5 = .00
22: 0 times 0/5 = .00
In other words the idea is to roll a 17 or larger (or whatever the hold number happens to be), but if you roll a 1, then your score is a 0.
#include <iostream>
#include <cstdlib>
#include <ctime>
using std::cout;
using std::cin;
using std::endl;
int dieRoll();
[Code] ....
View 4 Replies
View Related
Jan 8, 2014
I'm trying to keep track of the size of blocks of memory that a pointer points to. No matter what I do, this code below always outputs the integer 8.
If I change 1000 to 5, I still get 8. If I change it to 0, I get 8... If I change it to -1, I get 8. If I change int *a to double *a, I get 8. If I take away the & symbol, I get 8. If I use *& instead, I get 8.
Why? I want it to output 1000. If I change that to 500, I want it to output 500.
int *a;
a = malloc(1000 * sizeof(int));
int j = sizeof(&a);
printf("%d", j);
I want to build my skills where I can allocate, inspect and change memory sizes.
View 4 Replies
View Related
May 20, 2014
I want to make a program to print the product of even numbers between 1 and 30 and sum of odd numbers between 1 and 30. But the answer of product is negative. The photo shows the output of the code.
#include <stdio.h>
#include <conio.h>
void main ()
{
int i, even_product=1, odd_sum=0;
for(i=1;i<=30;i++) // For loop starts here!
[Code]...
View 5 Replies
View Related
Jan 25, 2015
So i have made an array and made a scanf in a for loop so it can store all numbers entered from keyboard in the array but i dont know how to put the numbers that are less than 5 in another array and then print that array out and the lenght of the array.
View 11 Replies
View Related
Feb 1, 2013
is there anyway to have a program where it ask for three numbers and you shows which which number is the largest and which is the smallest, e.g.
Enter 1st number: 30
Enter 2nd number: 10
Enter 3rd number: 30
Largest = 30
Smallest = 10
View 12 Replies
View Related
Apr 14, 2013
I am writing a program that prints the sum of even and odd numbers and here is my code
#include <iostream>
using namespace std;
const int SENTINEL = -999;
int main() {
int integers = 0;
int even = 0;
int odd = 0;
[Code] ....
Nut now in the output it adds -999 to the odd numbers ....
View 3 Replies
View Related
Mar 20, 2013
I'm practicing so I wrote this simple program that suppose to add and divide two numbers. It does that but the result comes out with a 0 at the front and don't know why.
#include<iostream>
using namespace std;
int main()
{
int a ,b;
int result;
a = 0;
b = 0;
[Code]...
View 4 Replies
View Related
Sep 25, 2014
Q)Write a program to find the sum between (2 numbers )
what's the problem here !
#include<stdio.h>
main()
{
int a,b,c;
int sum=0;
for(a=0;b>a<c;a++)
{
printf(" number1=");
[Code]...
View 5 Replies
View Related
Sep 2, 2013
I have a homework assignment due that told me for the "input specification" that "n" is an integer greater then 0. How would I put this in and where?
View 1 Replies
View Related