Procedure: 1. Create a folder on the PC in D drive under the lab5 folder in which to store all of your work, use your name as a name to the sub-folder you just created. 2. Study program lab_06.c below. 3. Run the program on the given circuit; 4. Modify the program so that it works like a simple calculator: · " + : Add" · " - : Subtract" · " * : Product: 1#include "16F877A.h" #use delay(clock=8000000) #use rs232(baud=4800,xmit=pin_c6,rcv=pin_c7) #include #define QUIT '3' int choice=0; int get_menu_choice( void ); void display_seconds( void ); main() { while (choice !=QUIT) { choice = get_menu_choice(); if (choice =='1') printf("Beeping the computer\a\r" ); else { if (choice =='2') display_seconds(); } else { if (choice =='4') my_first_char=getc( ); } } printf("You chose to quit!\r"); printf("reset your simulater to start again\r"); return 0; } int get_menu_choice( void ) { int selection = 0; char my_first_char; do { printf( "\r" ); printf( "1 - Beep Computer\r" ); printf( "2 - wait 10 seconds on Display \r"); printf( "3 - Quit\r"); printf( "\r" ); printf( "Enter a selection:\r" ); selection=getc( ); }while (selection '3' ); return selection; } void display_seconds(void) {int n; for (n=0;n
Procedure: 1. Create a folder on the PC in D drive under the lab5 folder in which to store all of your work, use your name as a name to the sub-folder you just created. 2. Study program lab_06.c below. 3. Run the program on the given circuit; 4. Modify the program so that it works like a simple calculator: · " + : Add" · " - : Subtract" · " * : Product: 1#include "16F877A.h" #use delay(clock=8000000) #use rs232(baud=4800,xmit=pin_c6,rcv=pin_c7) #include #define QUIT '3' int choice=0; int get_menu_choice( void ); void display_seconds( void ); main() { while (choice !=QUIT) { choice = get_menu_choice(); if (choice =='1') printf("Beeping the computer\a\r" ); else { if (choice =='2') display_seconds(); } else { if (choice =='4') my_first_char=getc( ); } } printf("You chose to quit!\r"); printf("reset your simulater to start again\r"); return 0; } int get_menu_choice( void ) { int selection = 0; char my_first_char; do { printf( "\r" ); printf( "1 - Beep Computer\r" ); printf( "2 - wait 10 seconds on Display \r"); printf( "3 - Quit\r"); printf( "\r" ); printf( "Enter a selection:\r" ); selection=getc( ); }while (selection '3' ); return selection; } void display_seconds(void) {int n; for (n=0;n
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Procedure:
1. Create a folder on the PC in D drive under the lab5 folder in which to store all of your work, use your name as a name to the sub-folder you just created.
2. Study program lab_06.c below.
3. Run the program on the given circuit;
4. Modify the program so that it works like a simple calculator:
· " + : Add"
· " - : Subtract"
· " * : Product:
1#include "16F877A.h"
#use delay(clock=8000000)
#use rs232(baud=4800,xmit=pin_c6,rcv=pin_c7)
#include
#define QUIT '3'
int choice=0;
int get_menu_choice( void );
void display_seconds( void );
main()
{
while (choice !=QUIT)
{
choice = get_menu_choice();
if (choice =='1')
printf("Beeping the computer\a\r" );
else
{
if (choice =='2')
display_seconds();
}
else
{
if (choice =='4')
my_first_char=getc( );
}
}
printf("You chose to quit!\r");
printf("reset your simulater to start again\r");
return 0;
}
int get_menu_choice( void )
{
int selection = 0;
char my_first_char;
do
{
printf( "\r" );
printf( "1 - Beep Computer\r" );
printf( "2 - wait 10 seconds on Display \r");
printf( "3 - Quit\r");
printf( "\r" );
printf( "Enter a selection:\r" );
selection=getc( );
}while (selection '3' );
return selection;
}
void display_seconds(void)
{int n;
for (n=0;n
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY