Name an electronic device and list prototypes of some function it may use.
Example: iPhone
bool checkPinCode(int pin); // Return true if pin is correct
void shutdown();
Let us take the case of MP3 PLAYER
List of prototypes some function it may use are -
Void turn_on(); //turn on mp3 player
void play_song(); //Start playing song in mp3 player
void pause_song(); //pause the song
void add_to_playlist(); //add song to a playlist
void stop_song(); //stop the song
void radio_on(); //turn on the radio
void radio_off(); //turn off the radio
void radio_tuning(); //turning the radio
void shutdown(); //shutdown mp3 player
Name an electronic device and list prototypes of some function it may use. Example: iPhone bool...
#include <iostream> #include <fstream> using namespace std; //constants const int CAP = 100; //function prototypes bool openFile(ifstream &); void readData(ifstream &, int [], int &); void printData(const int [], int); void sum(const int[], int); void removeItem(int[], int &, int); int main() { ifstream inFile; int list[CAP], size = 0; if (!openFile(inFile)) { cout << "Program terminating!! File not found!" << endl; return -1; } //read the data from the file readData(inFile, list, size); inFile.close(); cout << "Data in file:" <<...
In java6. Device Name SystemSuggested Problem Name: Device Name SystemSuggested Function Name: deviceNamesSystemCreate unique device names to be used in a residential loT (Internet of Things) system. If a device name already exists in the system, an integer number is added at the end of the name to make it unique. The integer added starts with 1 and is incremented by 1 for each new request of an existing device name. Given a list of device name requests, process all...
Your task is to complete the following function/functions: 1. Given a position in the linked list, delete the node at that position.(Silver problem - Mandatory ) 2. Print the sum of all negative elements in the linked list.(Gold problem) If you want, you can refer to the the previous recitation manual (which was on Linked Lists) to implement node deletion. #include <iostream> using namespace std; //----------- Define Node --------------------------------------------------- struct Node{ int key; Node *next; }; //----------- Define Linked List...
The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as a value returning function, returning the required item. If the location of the item to be returned is out of range, use the assert function to terminate the program. note: please give all code in c++ below is the class and implementation(a test program would be helpful in determining how to use it): class arrayListType { public: ...
Write an (efficient) pseudocode for the implementation of each of the following function prototypes (proper C code will also be accepted) - void print(Q) – prints the entire queue Q from front to back. - int enqueue(Q,x) – enqueues the element x into queue Q (if unsuccessful, return -1) - int* dequeue(Q) – dequeues the next integer from front of the queue (if unsuccessful, return null) - int isEmpty(Q) – returns 1 (true) or 0 (false) depending on emptiness of...
Please write in Java Recall that the ADT list class methods are; void List() bool isEmpty() int size() void add(int item, int pos)//inserts item at specified position (first postion is 1) void remove(int index)//removes item from specified position void removeAll() int indexOf(int item)//returns the index of item int itemAt(int index)//returns the item in position specified by index Implementation of LIST ADT operations and details are hidden. Only the methods listed above are...
In C programming, Modify the function Pop in the example so that it has the signature bool Pop(LIST *list, char *c) and returns false if the list is empty and returns true if not empty. On success it returns the value removed from the stack in the variable c. Modify the function CheckForBalance to accommodate this change and rerun the test program giving the same output as in the example. :here is the CheckForBalance example code, the rest of...
Using the provided table interface table.h and the sample linked list code linkedList.c, complete an implementation of the Table ADT. Make sure that you apply the concepts of design by contract (DbC) to your implementation. Once you have fully implemented the table, create a main.c file that implements a testing framework for your table. Your table implementation must ensure that values inserted are unique, and internally sorted within a linked list. table.h #ifndef _TABLE_H #define _TABLE_H //----------------------------------------------------------------------------- // CONSTANTS AND...
Code in C++ Function Prototypes For the second part of the lab activity, you will be practicing writing function prototypes. Continue working on the same project from part A. First, rewrite the code so that you are using function prototypes for the functions getNumber.getMessage, and repeat. Remember that the prototypes go at the top of the file, followed by main, then the definitions of the three functions at the end. Second, you will be creating a new function (procedure) called...
You are given a Q1.h file with overloaded function prototypes for isOrdered. Implement this overloaded function into a file named Q1.cpp. Q1.cpp should only include your function implementation, the necessary #include directives if needed, and should not contain anything else such as the main function or global variable declarations. Test your code using a separate main.cpp file where you implement a sufficient number of test cases. You should use Q1.h as a header file and Q1main.cpp as a main function...