Write small program to implement the specified functionality

Assignment Help C/C++ Programming
Reference no: EM131251279

Program

Overview

This assignment is a "warm-up" exercise. Its purpose is to gain experience with interpreting man pages, with reading and understanding function prototypes, with using system calls and C library functions, and with using UNIX programming utilities and development tools. To help with this process you will develop a small program that uses the termios library.

Activities

Write a small program (specified below) that uses library calls to implement the specified functionality.

This programming project is an individual assignment (i.e. you must each write your own code).

Submit your well-documented source code along with a sample run. Please use professional documentation and presentation standards as learned in introductory programming courses.

Be prepared to demonstrate your program.

Programming Assignment (No Echo)

All UNIX systems contain a terminal interface for enabling interactive communication between a user (presumably using a terminal-type device such as the console or an xterm) and the kernel. The POSIX standard defines such an interface, called termios (terminal input/output system). Like many APIs (application programming interfaces), termios consists of internally maintained status data and a set of functions that access that data. Note that in most APIs, functions that return information usually contain the word "get" in their name and those that modify data structures generally contain a "set".

By using the function calls associated with the termios API, a program can query a terminal to determine its present state and change the terminal's behavior by modifying the termios data structures. As is often the case, the internal data structures maintain a notion of state in the form of flags; the flag bits are then queried for information return or manipulated to control the behavior of the terminal. For example, a termios function can query the system to determine the terminal control mode. Another function can be used to modify the system to map all input to lowercase. This mechanism can be used to control many useful features of an input/output device.

Your assignment is to write a simple program that accepts user input without echoing it back to the terminal. This would be advisable, for example, when asking a user to enter a password or passphrase. In particular, your program should:

obtain and store the default (currrent) terminal parameters
modify the current terminal behavior to turn off terminal echo
input a word or phrase (i.e. the password/passphrase)
output the data the user entered
restore default terminal behavior
Here is what a sample run might look like:
[eos02:~/cs452]$ program_01

Disabling echo.

Enter secret word/phrase:

You entered: secret

Default behavior restored.

[eos02:~/cs452]$

To successfully complete this assignment, you will need to review or learn about:

basic terminal input/output (e.g. file descriptors, I/O functions)
using library functions (i.e. understanding function prototypes)
accessing system data structures
flags, masks, bit manipulations (e.g. |, &).

Reference no: EM131251279

Questions Cloud

Estimating the expected completion time : A certain project network consists of three paths. The first path has an expected completion time of 15 weeks and a path variance of 5 weeks, the second path has an expected completion time of 10 weeks and a path variance of 3 weeks, and the thir..
How is technology changing the ethical issues : How is technology changing the ethical issues the healthcare administrator must face? - Discuss the challenges of balancing ethical principles, quality control, fiscal (monetary) concerns, and the organizational mission.
When might it be a bad idea to use ppp theory in this way : Explain how you would figure out the dollar/pound exchange rate implied by PPP. When might it be a bad idea to use the PPP theory in this way?
What is hypothesis testing : What is hypothesis testing? Explain the general process and the steps included in conducting a hypothesis test? What is the difference between parametric and nonparametric hypothesis testing?
Write small program to implement the specified functionality : Write a small program (specified below) that uses library calls to implement the specified functionality. This programming project is an individual assignment (i.e. you must each write your own code).
Factors of resistance to change : Describe the organizational factors that create stress and discuss how they compare to the factors of resistance to change. How are they similar and different? Are the methods for managing change useful for managing stress caused by organizational..
Research a organizations strategic plan : Research a organization's strategic plan and competitive perspective. Do a SWOT analyses on this company. - The eText, and the items under lecture give a good idea on what goes into a SWOT analyses.
Respect to the management of the firm : What are the partners' rights with respect to the management of the firm? Is the partnership bound to the contract with United? Do the partners split the first year's profits? If so, how much is each entitled to?
What budgeting approach should the athletic department use : The intercollegiate athletics department at Coastal Atlantic University (CAU) has major budgeting issues. For the 2015 fiscal year, the university's Board of Trustees has approved a $20.4 million budget for the department. What budgeting approach ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Build a definition for a class that stores data

Using C++ language, build a definition for a class that stores data about a two dimensional vector. The class has to have mutators and accessors to get and set the x and y values. Make x and y integers. Then overload the operator * so that it retu..

  Write a program with a while loop to print 1 to n in square

Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user. (i) Write the same program using a for-loop

  Write a program that reads an unspecified number of numbers

Write and run a program that reads an unspecified number of numbers and then prints them together with their deviations from their mean.

  Write a function that permanently swaps two integers

Write a function that permanently swaps two integers using pointers.

  An expression whose value depends upon the evaluation

Give an example in C++ of an expression whose value depends upon the evaluation order. Show the orders that produce different values and the values they produce. Explain what side effect is the expression contains.

  In this assignment you have to implement and test a public

in this assignment you have to implement and test a public transport fare ticketing system. you will need to

  Write a menu-driven c++ program for food purchases

Write a menu-driven C++ program for food purchases at the baseball stadium's restaurant. The main program will loop allowing the user to select food items from the menu adding each item to the bill, terminating when the user selects the "End order..

  Human-computer interaction

What impact does each communication type have on human-computer interaction (HCI)? Provide an example for each to illustrate these impacts, if any. Support your answer with appropriate rationale.

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Program to compute the weekly wages repeatedly

It contains the C++ wages program using a repeat loop in order to enable the user to compute several wages. The loop ends when the user enters -1 for either the hours_worked or the pay_rate. C++ uses the "do" keyword instead of "repeat".

  Accept positive and negative numbers in its input sequence

the program must accept positive and negative numbers in its input sequence, and ?nd the largest and smallestof the numbers entered whether they are all positive, all negative, or a combination of both positive and negative.

  Exponent and significant of a floating point

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum, subtraction or multiplication.

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