C :: Secure Entry Keypad Simulator

Feb 15, 2015

We've been tasked write a code which would mimic a secure entry keypad.. Only recognising the digits 0-9 for the passcode, and non-numerics S (start again) C (clear last digit) and E (enter) for the control. All other key strokes are to be ignored.

The passcode has to be <10 digits and represented on the screen by "****", with any keystrokes >10 ignored.
The valid passcode being 4 digits (1234).

With 3 attempts to get the correct pass code, after each fail attempt as please try again message show, where after the 3rd attempt a specific message is displayed and an alarm sounds..

View 13 Replies


ADVERTISEMENT

C# :: Keypad In Windows Form

Jan 7, 2015

How to make a keypad in my windows form? Need to finish my project at school...ATM machine app..

It is just the keypad part. Do i put 10 buttons and add a textbox...

View 2 Replies View Related

C++ :: Application To Load Other Applications In A Secure Shell Based On User Interaction

Jul 9, 2013

I will sketch the scenario I would like to get working below. I have one main application.

That application, based on user interactions, can load other applications in a secure shell. This means these child applications cannot interact with the OS anymore, nor with each other.

The parent program can at any time call functions of these child programs.

The child program can at any time call functions of these parent programs.

How to implement this in C++? Preferably both parent and child should be written in C++.

The performance of loading the child applications doesn't matter. The only thing that matters is the performance of the communication between child and parent.

View 4 Replies View Related

C++ :: Bit Shifting - Cache Simulator

Apr 18, 2013

I'm attempting to make a cache simulator in C++. But I need to access individual bits in an integer to figure out where in my "cache" the writing actually gets done. I'm pretty new to bit shifting. Say I'm trying to access the the bits of the int 5, which are its "address". I'm simulating a direct mapped cache. I need to find its tag, the set it goes into, and which line. How do I use bit shifting to access the bits to acquire the tag, the index bits, offset bits, block number...all these pieces in order to actually find where I store it in the cache.

View 6 Replies View Related

C++ :: Gravity Simulator Implementation

Jul 9, 2013

I've been working on creating a simulator to crash two galaxies together as part of a project to stress test a CUDA super computer. I've got a long way to go and am currently just working on correctly simulating n-body gravity functions. First I will use this to simulate the cores of the galaxies (the black holes) and eventually the stars.

So long story short I'm working on the beginnings of a gravity simulator. At this point I found some basic code that works well but doesn't quite give the effect I'm looking for.

The code below only pulls each object towards each other like a spring faster and faster until they shoot off into infinity. I try to give one of my bodies an initial velocity to get it to orbit another, but it always just shoots straight at the other body. I'm thinking I need to factor in inertia so that the initial velocity doesn't just get calculated away really fast by the other calculations.

I'm really looking for a bit of direction to get a real gravity simulator with orbits and such working right so eventually I can scale it up to a galaxy, throw in 100B stars and let the CUDA run for a month..

Code:
void update_galaxies(GLdouble elapsedTime) {
//Calculate gravity simulations
GLdouble r1, r2, r3;
r1 = r2 = r3 = 0.0;

for(unsigned int i = 0; i < galaxies.size(); i++)

[Code] ....

As you can see, I'm calculating all the bodies in a vector called "galaxies" with each other, and doing a basic gravity calculation to it. The update_position function simply takes the calculated acceleration and uses it to calculate the velocity and position based on the "elapsedTime".

I think I need to use the Varlet or Runge-Kutta integration methods, after doing a bit more research.

View 9 Replies View Related

C :: Cache Simulator - Bit Shifting

Apr 21, 2013

I'm attempting to make a cache simulator in C++. But I need to access individual bits in an integer to figure out where in my "cache" the writing actually gets done. I'm pretty new to bit shifting. Say I'm trying to access the the bits of the int 5, which are its "address". I'm simulating a direct mapped cache. I need to find its tag, the set it goes into, and which line. How do I use bit shifting to access the bits to aquire the tag, the index bits, offset bits, block number...all these pieces in order to actually find where I store it in the cache. I need to break the bits up into 3 sections: tag, set index, and block index. I think I can figure out the set and block index sizes based on the values passed in. The tag bits are just the remaining ones. And I'm hard coding values such as cache size (C) - 1024, number of physical address bits (m) - 32, block size (B) - 2, number of lines per set (E) - 1 (again, directly mapped cache). How would this look? I'll be using unsigned longs, so it can handle up to 64 bits.

View 3 Replies View Related

C++ :: Dice Simulator - Floats Rounding Up

Oct 28, 2013

I made this dice simulator which basically throws the dice 1 million times and outputs the frequency and percentage average for each side (1 to 6).

Everything is working fine, except my averages (floats) seem to be rounding up, causing 4% being "unassigned" at the end of the million rolls. I'm outputting with a setprecision of 2, but I only get 0's and no fractional numbers.

View 5 Replies View Related

C++ :: Creating Space Simulator Program For University

Aug 5, 2014

I'm creating a space simulator program for uni and I've got 3 errors that I just can't seem to fix.

View 10 Replies View Related

C/C++ :: Simulator To Implement Populations For Given Number Of Months?

May 18, 2013

How can i implement a simulator that computes the populations for a given number of months for all sectors.

View 1 Replies View Related

C++ :: Error Handling - Enigma Cipher Simulator

Jan 4, 2014

I finished my Enigma cipher simulator...how should I write the error handling code? Should I throw an exception in main, or in the Enigma ctor and Encrypt() fn when the user enters a non-alphanumeric character?

Rotor.hpp

Code:
#ifndef ROTOR_HPP
#define ROTOR_HPP
class Rotor {
public:
Rotor(char pos='A');
Rotor(const Rotor & rhs);
Rotor& operator=(const Rotor& rhs);

[Code] ....

Output

Code:
Enter rotor settings:
ABCDEFGHIJ
Enter cleartext:
HELLO WORLD
Ciphertext:
0O258 SGY5V

View 3 Replies View Related

C++ :: Airline Reservation Simulator - Binary File Errors

Aug 11, 2014

For a big project for school I have to make an airline reservation simulator but I have run into a problem. I want to save the the flight code and its location in a binary file so that I can obtain a code according to the location but this happens:

[URL] ... (link to current output and expected output)

Here is the source class

class file {
private:
char code[8];
char from[20];
public:
void input();

[Code] ....

View 4 Replies View Related

C++ :: Battle Simulator - Save / Load Functions Not Working

Oct 16, 2013

I've been working on a battle simulator, and using it as a learning experience. So far, I've been able to debug the program, and learn some stuff, and it's been running smoothly. It's still runnable, but I've been trying to make it so the player can save his character, and continue the game later. However, I'm not sure whether it's the save or load function that's not working, because even if i save to a txt file, it's just a bunch of random characters. I don't know if that means it's not saving correctly, or if it's just supposed to be like that. Anyway, here are the two functions I'm speaking of:

Code:
void Game::saveGame(Character &player) {
std::ofstream saveFile("save.bin", ios::binary);
saveFile.write((char *)&player, sizeof(player));
saveFile.close();

[Code] .....

My program is in multiple files, so I can't really post the whole code easily, but I can upload or something if I really need to.

View 14 Replies View Related

C++ :: Highway Simulator - Cars Move From Start Point To Quit At End

Jun 12, 2013

i want to draw a highway, this simulator must not be graphical (must draw by "|" and "-" and...) . this highway include 3 type of car,

1- heavy
2-light heavy
3-light, t

These cars move from start point to quit at end of highway, highway must be object (programmed by class), and have 200 columns and 4 raw, it must be horizontal... . the cars speed are different,

speed =1,2,3; length=1,2,3;

View 3 Replies View Related

C++ :: Adding Entry To Map?

Feb 5, 2013

I have the following code in sourceFile.cpp. functionA() is first called and inserted entires for key1, key2 and key3. Then functionB() gets called to use the vectors for the 3 keys. I want to free all memory after exiting functionC(). Among the three ways to put an entry into the map for the 3 keys, which is correct / better?

Class ClassA { ... }
ClassA *key1 = new ClassA();
ClassA *key2 = new ClassA();
ClassA *key3 = new ClassA();

[Code]....

View 2 Replies View Related

C/C++ :: How To Create Entry Verification

Nov 21, 2014

I have an assignment to create a program that will display the duplicate numbers that were entered by a user. I have the code finished and I have covered the basic requirements of the assignment. However, during my testing I found that if I enter anything other than a whole number (i.e. char or float) the program will run out and exit. I would like to add a little code to verify that the user has entered a whole number. I cannot seem to get this to work though. I have written other codes that verify if a number is above and below a certain value, I just do not know how to look for a certain type of entry.Here is my code:

int main() {
int number[20];
int duplicateNumber[20];
int i, j, k, counter = 0;
// Get number input from the user
for (i = 0; i < 20; i++) {
printf("Please enter a whole number %d: ", (i + 1));

[Code]...

View 3 Replies View Related

C++ :: Displaying Average For Each Entry

May 3, 2013

I have to display an average for each student that is entered ....

void StudentData::displayAverageScore() {
double totalScore = 0;
double totalEx1 = 0, totalEx2 = 0, totalEx3 = 0, averageScore = 0;
for(int i = 0; i < entries.size(); i++) {
totalEx1 += entries[i].getEx1();// accumulate totals
totalEx2 += entries[i].getEx2();
totalEx3 += entries[i].getEx3();
if(totalScore != 0) averageScore = (totalEx1 + totalEx2 + totalEx3) / 3; // don't divide by 0
cout << "Average Score For Exams: " << setprecision(1) << fixed << averageScore << endl << endl;
}
}

View 7 Replies View Related

C++ :: Adding Entry Into Array?

Aug 6, 2014

My program is suppose to be as a virtual phone book that allows you to add,search, display names and numbers.

At the beginning you are able to add up to 10 entries and then from there the program goes to a menu where you can add more entries, search etc.

My problem is that I am unable to add an entry into the existing list of names/phone numbers.

Example: At the beginning I add Joe,Albert,Barry. It sorts them into Albert, Barry, Joe (good so far!)

However, if I choose to add another entry (Carl) it becomes Barry,Carl,Joe.

The functions I am using to add entries are: GetEntries (for initial entries) and Addentries for more entries during the main program.

*******************************COPY OF CODE**********************************

#include <iostream>
#include <string>
using namespace std;

[Code].....

View 5 Replies View Related

C++ :: Makefile Only Executing First Entry

Mar 15, 2013

Why this makefile only executes the first entry, compiling only the first program listed?

###########################################################
#
# Simple Makefile for Operating Systems Project 2
#
###########################################################
vowcon:
g++ -o vowcon vowcon.cpp -pthread
osproj2c:
g++ -o osproj2c osproj2c.cpp -pthread
osproj2b:
g++ -o osproj2b osproj2b.cpp -pthread
osproj2a:
gcc -o osproj2a osproj2a.c -pthread
clean:
rm osproj2a osproj2b osproj2c osproj2d vowcon

View 7 Replies View Related

C/C++ :: While Loop To Stop After Third Entry

Jul 6, 2014

Having multiple issue trying to get a while loop to stop after the third entry.

#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;
int mySequentialSearch() {
int value;
string line;

[Code] .....

I am just working on the while loop right now. Then the function after I get the loop working.

View 10 Replies View Related

C :: The Last User Entry In Loop Fprintfed Twice?

Apr 13, 2014

Still working on my first homegrown C program design . The function basically allows the user to enter a list of classes and grades and saves the list to a file to be used later in the file. The function compiles and runs through without error except for the fact that it always prints the last user entry to the *profilep file twice. Just as a note, the scanchar function is one I made to scan in one character and an end of line character to throw away the end of line char before I learned about %*c about 30 minutes ago...

Also I haven't much bothered to strengthen the function against crazy user input but I have heard using fgets and sscanf in conjunction can replace scanf and protect against weird user input. How to apply this within the program.

Code:
// creates a new profile and prints it to the profile file.
void newprof(FILE* profilep, const char *allclasses[ABBR_SIZE]){
int c, checker, counter;
int i, a;
char prof[MAX_PROF][ABBR_SIZE];
char grades[MAX_PROF][3];

[Code] .....

View 1 Replies View Related

C++ :: Error 453 - Can't Find DLL Entry Point

Nov 7, 2013

Using VC++ 2010 Express. I am creating a dll to export a simple Multiply function so I can use it in Excel/VBA

These e are the steps I am following :

. Create a Win32 C++ Project and give a name. For example: CallDllFromVBA
. Select the DLL option in the Wizard and click Finish
. In the CPP file (here CallDllFromVBA.cpp), add the following code

#include "stdafx.h"
int _stdcall Multiply(int x, int y) {
return x * y;

[Code] ....

The Build output show everything is ok as follows :

CallDllFromVBA.cpp
CallDllFromVBA.vcxproj -> c:documents and settingsadministrateurmes documentsvisual studio 2010ProjectsCallDllFromVBADebugCallDllFromVBA.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

In VBA, I insert a module and add the following code:

Declare Function Multiply Lib _
"c:documents and settingsadministrateurmes documentsvisual studio 2010ProjectsCallDllFromVBADebugCallDllFromVBA.dll" _
(ByVal x As Long, ByVal y As Long) As Long
Sub test()
MsgBox Multiply(2, 4)
End Sub

When I run the Test sub I get the error: 453 - Can't find dll entry point

I also opened the CallDllFromVBA dll with Dependency walker and I can't find the Multiply export function - In fact, the dependency walker doesn't show any function exports at all for the CallDllFromVBA dll !

View 2 Replies View Related

C/C++ :: Conditional Multiple Entry Points?

Nov 16, 2014

I'm playing with my final year project, building a game boy emulator in C, and I wanted to try out something to streamline my code base. I'm building against Win32, GNU C and Googles Native Client.There are no platform specific headers or functions in use. What I'm trying to do is have a file that conditionally includes the entry point (so _tmain for Windows etc) based on a preprocessor directive being set/not-set.

[note] I realise I could write both entry point classes in one file and use the preprocessor directive in there, but it's not as neat as a single file calling in one or the other. I figure this should work because I can conditionally include headers for Win/NaCl (providing the signatures match, of course).

View 3 Replies View Related

C++ ::  Passing A Polymorphic Array Entry

May 31, 2013

I'm having an issue during the linking stage of the .exe during compile time, and it's because of a call to a function with a polymorphic parameter.

//here's how the classes are setup
class grandpa {};
class mom public grandpa{};
class dad public grandpa {};

[Code]....

dad has sons in the vector and mom has daughter in the vector. What I want to do is have a function that can accept either of these vectors as one parameter like so: void func(const grandpa* aObject);

Finally, I have an error when I pass an object to the function like so: func( d[0] );

View 1 Replies View Related

C/C++ :: Modifying Row Of Matrix Based On Zero Entry?

Nov 19, 2014

Here is the problem:

Write an algorithm such that if an element in an M * M matrix is 0, its entire row and column is set to 0.

Your function prototype may look like the following:

void setZeros ( int size, int arr[][size] );

Heres what I have:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 3
void scan_matrix(int arr[][SIZE]);
void print_matrix(int arr[][SIZE]);
void initiailize_matrix(int arr[][SIZE]);
void set_zeros(int matrix[][SIZE]);

[code]....

I'm not sure on how to scan zero for this code and I have bolded some comments that I am having trouble with as well.

View 1 Replies View Related

C# :: How To Add Data Entry List In Array

Jan 29, 2014

I'm learning C# and having fun and I've been practicing by working on this little data entry console application. Basically the user inputs first name, last name, age, gender, employee id, then I ask the user if he/she wants to add another entry, if yes then loops back at the top, and if no, it prints out the amount of entries added. The issue I'm having is that the entry list is never kept or stored when adding another entry, it replaces what was entered before which is not what I'm looking for. I don't know how to stuff one entry list information seperately in an array so that I can print out which ever entry the user decides to choose once he/she is done adding entries. Is there a way to make this work?

Here is my program code:

using System;
namespace Ch02_Exercises_12
{
class Program {
static void Main() {
string firstName;
string lastName;
string input;
sbyte age;
char gender;

[Code] .....

View 4 Replies View Related

C/C++ :: Prevent Duplicate Entry When Insert Age

Oct 17, 2014

I created program that insert employes data and then print their data but never accept duplicate age if user entered duplicated age prompt him to enter another age (age must be unique)

Here is my code

#include<conio.h>
#include<stdio.h>
#define size 3
struct emp {
int age,overtime,dedcution,netsal;

[Code] .....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved