Write a program to act as an electronic safe, C/C++ Programming

Assignment Help:

Write a program to act as an electronic safe. If the correct code has been entered the program should display "Safe Open".  If an incorrect code is input it should display "Alarm" and cannot be reset.
 
#include stdio.h
void main()

  char prompt;
  int dial,code;
/* set up code */
  printf("Please enter in the numerical code \n\r");
  scanf("%d",&code);
/* Lock up safe */
  printf(" Safe locked \n\r Please enter access ... ");
  scanf("%d",&dial);
  while (dial != code )
  {
    printf("Alarm sounded \n\r");
 
  }
  printf("Safe opened \n\r"); 
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt); 
  }


Related Discussions:- Write a program to act as an electronic safe

Solve, solve for radius(R) of a circle of its area is to be inputted by a u...

solve for radius(R) of a circle of its area is to be inputted by a user. also display compute the circle diameter hint: area= pir21 pi=2.1416

Symbolic constant, S y m b o li c c o n s t a n t : c ...

S y m b o li c c o n s t a n t : c on s t m a x = 1 0 0 ; T h e d e f a u l t d a t a t y p e w i l l b e i n t e

Decoding smugglers message, Smugglers are becoming very smart day by day. N...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

PEBBLE MERCHANT, There is a pebble merchant. He sells the pebbles, that are...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

What does it mean to declare a member function as a virtual, What does it m...

What does it mean to declare a 1.      member function as a virtual A: (a) C++ virtual function is member function of any class, whose functionality may be over- ridden in

Custom scans and alerts think or swim, Custom Scans and Alerts Think or Swi...

Custom Scans and Alerts Think or Swim Project Description: I am seeking somebody to make me several Custom Scans and Alerts on Thinkorswim TOS Skills required are C++ Prog

Nonlinear least squares minimization, Estimation of the yield curve using n...

Estimation of the yield curve using nonlinear least squares minimization: The last part of this assignment asks you to construct the Nelson Siegel yield curve from observed bond pr

Explain difference between early binding and late binding, What is the diff...

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

C programming assignment, good night i have an assignment that i really nee...

good night i have an assignment that i really need help with. i have to create a struct file with tag name book to have members int book_id char isbn[255]

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd