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...
Function name : contains_substring Parameters : string (string), substring (string) Returns: bool Description : If the substring is entirely contained within the string, then return True, otherwise return False. An empty substring will always return False. The substring may be longer than the string. You are not allowed to just write “if substring in string”.
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...
The project I have is a link list that asks for a name and phone number and it allows the user to insert ,delete ,modify ,and find an element in the structure. The program has a menu in which the user can choose which function they want to use I need to use switch case to do this but it has not worked I need help with this. Thank you! #include <iostream> #include <string> #include <iomanip> using namespace std; const int...
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...
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...