df.h 1 #ifndef DF H 2 #define DF H 3 4 // Write your prototype here 5 6 7 main.cpp #endif 1 #include "df.h" 2 #include 3 #include 4 5 6 7 8 9 10 11 using namespace std; int main() { } CodeCheck string s; cap (cin, s); // read into s; convert to caps cout << s << endl; Reset
Q: (a) Apply Djikstra's algorithm to find the lowest cost path in Figure 1. Assume vertex B as the…
A: Dijkstra algorithm: It is used to find the shortest path between the nodes in the graph. It is used…
Q: With 1 parity bit we can detect all 1-bit errors. Show that at least one generalization fails, as…
A: The question is related to error detection and correction.
Q: Consider the situation in the previous exercise, except this time assume that the router has a queue…
A:
Q: . Suppose A is connected to B via an intermediate router R, as in the previous problem. The A-R link…
A: Consider the situation wherein there are two computers, A and B as shown below, with a router R in…
Q: Justify the requirement for a trained project manager to oversee complicated tasks.
A: The question has been answered in step2
Q: b. C. Derive the initial routing table for all the routers. In the next time slot, router t receives…
A: Routing:- Routing is the process of forwarding packets from the source machine to the destination…
Q: This is for C++. Trainer's enrollment Trainers at Tom's Athletic Club are encouraged to enroll new…
A: c++ C++ is a cross-platform language for producing advanced applications. Bjarne Stroustrup created…
Q: Write a C++ program that is used by video game shop to update the information of some video games,…
A: In this question, it is mentioned to write a "read" function that reads the games information from…
Q: d. Apply the Binary Search Algorithm, as performed during class, show Use the Algorithm presented…
A: The given List = [ 2 , 4 , 7 , 10 , 11 , 34 , 50 , 59 , 60 , 66 , 69 , 70 , 79 ] and we have to…
Q: hat is a base band OS? Explain how it is integrated with the main OS, Andr
A: Design: Description: A baseband processor is like a chip in a cellphone, pill, or any other device…
Q: 3.Write 4 examples for Web applications.
A: Introduction The following are the four examples of Web applications:- 1. Some websites like sports…
Q: 3) Solve following recurrence relations using backward substitution. a) T(n) = 2T (n/4) +1 for n >…
A: a) Given that, T(n)=2Tn4+1 for n>1, andÂn>1, and  T(1)=1 GivenÂT(n) ,we can calculate the…
Q: In a stack, items are added and deleted only at one end, referred to as the of the stack.
A: Stack: The Stack is a liner data structure that follows a particular order in which the operation…
Q: nd the smallest Max ] is in the receive wi e. nowing that MaxSec
A: 1) The smallest working value for MaxSeqNum is 8 It suffices to show that if DATA[8] is in the…
Q: # a 1 b A b 2 D a,b a 3
A:
Q: What does the statement 'guess == 5' do? a. assigns the value 5 to guess b. if guess is not equal to…
A: 1. Given statement is 'guess==5' In this statement, guess is a variable and == is a equality…
Q: short answer please compare and contrast the definition of a project versus a program
A: The answer for the above question is given in the below steps
Q: What is a firewall's principal purpose? What are the general guidelines for using packet filtering?
A: The above question that is what is firewall's principal purpose and what are the general guidelines…
Q: Given a network address of 165.100.0.0, 1000 needed subnets and 60 needed usable host per subnet,…
A: Network address: A Network address is an identifier for a node or host on…
Q: How can forensic investigators extract volatile and non-volatile data from PCs running Windows?
A: Both are used here because, in accordance with the question, they are both utilised to safeguard…
Q: Consider a simple protocol for transferring files over a link. After some initial negotiation, A…
A:
Q: minimum-cost SOP and minimum-cost POS expre
A:
Q: Don't need to elaborate the answer. Just write down the correct answer. 9) The figure below…
A: As you asked only for options the correct options has been answered in step2
Q: Subsystems and logical divisions combined on one machine: what are the advantages?
A: Here is the answer with an explanation:-
Q: Calculate the latency (from first bit sent to last bit received) for the following: (a) 100-Mbps…
A: Here we have given the solution for the questions asked in step 2.
Q: Let x[n] = {1,2,3). Let y[n] = {1, 2, 3, 4, 5). Circularly convolve x and y where N = 6. Develop the…
A:
Q: Suppose you are designing a sliding window protocol for a 1-Mbps point-to-point link to the…
A: One way latency of link is 100ms Bandwidth = 1Mbps = 106 RTT = 0.2 s Bandwidth delay product = 106…
Q: Prove that the Internet checksum computation shown in the text is independent of byte order (host…
A:
Q: Software Architecture It describes how the system is organized as a set of communicating components:…
A: Below is the answer to above question. I hope this will be helpful for you..
Q: (i) A sequence diagram can describe the architecture elements of a software application. (ii) Both…
A:
Q: HW2: Write a computer program in Fortran 90 to read the day, then print the work condition as shown…
A: PROGRAM PrintWorking IMPLICIT NONE integer :: dayofweek CHARACTER(LEN=10) :: full,half,holi PRINT *,…
Q: If the size of each 4-bit memory component is 4 x n cells
A: The answer is
Q: Java - For 7 and 8 use the following definition: class node { boolean…
A: The answer is as follows.
Q: 2. Answer the following the questions. Show work on the space provided below the problem. Write…
A: Disclaimer: “Since you have asked multiple questions, we will solve the first question for you. If…
Q: Path MTU is the smallest MTU of any link on the current path (route) between two hosts. Assume we…
A: The Path MTU is smallest MTU. Now in that case, The Path MTU size is 576 bytes. So, the maximum…
Q: Construct a Binary tree using following information Inorder sequence - 1,2,3,4,5,6,7,8 Pre-order…
A: The tree in which every parent node has at most two child nodes is known as a Binary tree.
Q: Write a java program to check if a list of integers contains only odd number. Please do it using…
A: I have provided JAVA CODE along with CODE SCREENSHOT and 2 OUTPUT SCREENSHOTS-------------…
Q: Indices can speed up query processing, but it's usually a terrible idea to index every attribute,…
A: Through the creation of pointers to the locations of data within a database, indexing speeds up…
Q: Determine a possible regular expression that could define a language containing strings ab, acb,…
A: Given data is ab, acb, accb, adb, addb, adddb, ... The possible regular expression is "…
Q: Synaptic weights are w, 1.2, w, -0.4, w, 0.7. Find the given input above (or) below the line?
A: The answer is
Q: Consider this 2-D array named a: int [][] a = { }; { 47, 56, 77 }, ( 56, 77, 47 }, {77, 47, 56 }…
A: Q. Consider this 2-D array named a: int [][] a = { { 47, 56, 77 }, { 56, 77, 47 }, { 77, 47, 56 } };…
Q: Suppose that the matrix X contains the exponential windowing data and that a new data vector x…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: How can forensic investigators extract volatile and non-volatile data from PCs running Windows?
A: Automatic extraction of volatile and non-volatile information from disk drives is one of the most…
Q: 28. In stop-and-wait transmission, suppose that both sender and receiver retransmit their last frame…
A:
Q: Calculate the latency (from first bit sent to last bit received) for: (a) 1-Gbps Ethernet with a…
A: Introduction: In this question, we are asked to calculate the latency for thee different scenario,…
Q: Q2: write an algorithm to print the numbers between 1 and 20 that divide by 2. (hint :(%) use to…
A: Algorith for above : step 1: START step 2: declare variable i ← 1. step 3: check if i % 2 is…
Q: 4. Consider using a simple linked list as a dictionary. Assume the client will never provide…
A: Below is the complete solution with explanation in detail for the given questions.
Q: If you include inanchor: in your query, Google will restrict the results containing the query terms…
A: The answer is written in step 2
Q: Draw a timeline diagram for the sliding window algorithm with SWS = RWS = 3 frames, for the…
A:
Q: 4. Write a function to compute the following: i.e. the area and perimeter circle as given below. No…
A: import math #to use value of pidef areaperi(r): area = math.pi*r*r perimeter = 2*math.pi*r…
Examine main.cpp to see how the function is used, then write the correct prototype. This is a little harder than the previous two exercises.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 1. Mark the following statements as true or false. a. An identifier must start with a letter and can be any sequence of characters. (1) b. In C++, there is no difference between a reserved word and a predefined identifier. (1) c. A C++ identifier cannot start with a digit. (1) d. The collating sequence of a character is its preset number in the character data set. (2) e. Only one of the operands of the modulus operator needs to be of type int. (3) f. If ; and ;, then after the statement ; the value of b is erased. (6) g. If the input is 7 and x is a variable of type int, then the statement ; assigns the value 7 to x. (6) h. In an output statement, the newline character may be a part of the string. (10) i. In C++, all variables must be initialized when they are declared. (7) j. In a mixed expression, all the operands are converted to floating-point numbers. (4) k. Suppose . After the statement ; executes, y is 5 and x is 6. (9) i. Suppose . After the statement ; executes, the value of a is still 5 because the value of the expression is not saved in another variable. (9)in C++ PLEASE #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <stdlib.h> #include <iostream> #include <pthread.h> #include <semaphore.h> #include <atomic> using namespace std; // The length of time the program should run int run_time; // The buffer that will be produced into and consumed from. int *buffer; int buffer_size; // The number of producers and consumers we will have int num_producers; int num_consumers; // TODO: Declare the semaphores that you will need to implement this algorithm // Semaphores are of type sem_t // TODO: Declare a mutex that you will use in your implementation. // Use type pthread_mutex_t // TODO: Declare any other global variables you will need to // use to implement your algorithm // These atomic variables will be used simply to generate unique numbers // to identify each thread. atomic_int producer_num(0); atomic_int consumer_num(0); // This is the function that will be…What data would you put together into a struct so that it would make that program easier to manage and make the data on it easier to manage. C++ #include<iostream> #include<cmath> #include<limits> //Define constants Pi #define PI 3.14 using namespace std; //Define a function to calculate the radius double calculateRadius(int x1,int y1,int x2,int y2) { //Compute radius double radius = sqrt(pow(x2-x1, 2) + pow((y2-y1), 2)); //Return radius to calling function return radius; } //Define a function to calculate Area double calculateArea(double radius) { //Return area to calling function return PI * radius * radius; } //Define a function to calculate perimeter double calculatePeriemeter(double radius) { //Return perimeter to calling function return 2*PI*radius; } int main() { //Variables declaration int x1, y1, x2, y2; double radius, area, perimeter; cout<<"\nPlease enter the center point in the form x y: "; cin>>x1>>y1; while(1) { if(cin.fail()) {…
- C++ Please! Also please don't use functions, arrays, or classes. Just basic c++ please. Password Verifier Write a C++ program to verify that a user’s password meets the following criteria: 1. The password should be at least 6 characters long. 2. The password should contain at least one uppercase and one lowercase letter. 3. The password should have at least one digit. Your program should ask the user for a password and verify that it meets the following criteria. If it doesn’t a message should be displayed telling the user why.5: CheckLetter.cpp) Write a program that adds a checkletter to an eight-digit number. The check letter should becomputed as follows: Break the number up into 4 two-digitnumbers. Add the four numbers together. Find theremainder after division by 26. The check letter is the letterin the alphabet that corresponds to the number justcomputed. (A=0, B=1, C=2, etc.) Print the original numberfollowed by the check letter. Use at least one ffunction thatreturns a value when you write this program.Please solve usnig c++ programming language. Number Converter Program as described in the UML has the following functionality.1. Read a number from the user and find its base. If number is exceeding the limit of 16-bits,ask user to re-enter the number. Use parameterized constructor Conversion(char *) toinitialize the data member.int FindBase(char []);There are a few assumptions. i) If all digits of a number are 0 or 1, the number is binary. For example, 1010 will beconsidered a Binary number only.ii) A hexa-decimal number must have letter A, B, C, D, E or F. Otherwise the number willnot be considered a hexa-decimal.iii) Decimal number must have minimum one digit greater than 7. Otherwise, the numbercan be considered as Octal if it does not meet the criteria in point no. i and ii.2. Converting the number to Binary if the number is not Binary.char * ToBinary(char *);3. Converting the number to Octal if the number is not Octal.char * ToOctal(char *);4. Converting the number to…
- CONVERT THIS CODE TO C# Code For ATM Withdraw Sysytem C++ code: #include <iostream>#include <stdlib.h>#include <string.h>using namespace std;class Bank { // Private variables used inside classprivate: string name; int accnumber; char type[10]; int amount = 0; int tot = 0; // Public variablespublic: // Function to set the person's data void setvalue() { cout << "Enter name\n"; cin.ignore(); // To use space in string getline(cin, name); cout << "Enter Account number\n"; cin >> accnumber; cout << "Enter Account type\n"; cin >> type; cout << "Enter Balance\n"; cin >> tot; } // Function to display the required data void showdata() { cout << "Name:" << name << endl; cout << "Account No:" << accnumber << endl; cout << "Account type:" << type << endl; cout << "Balance:" << tot << endl; } // Function to deposit the amount in ATM void deposit()…Question 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…*C Programming This exercise is to help you learn how to debug compiler warnings/errors and other common errors in your code. For each part labeled P(n), there is a warning/error/problem that goes with it. Write down what the issue was in the `Error:` section of each problem. Work on `segfault.c` along with your fixes and error comments. segfault.c file // P0#include <stdio.h>#include <stdlib.h>/* Error: */ void fib(int* A, int n); intmain(int argc, char *argv[]) {int buf[10];unsigned int i;char *str;char *printThisOne;char *word;int *integers;int foo;int *bar;char *someText; // P1for (i = 0; i <= 10; ++i) { buf[i] = i;}for (i = 0; i <= 10; ++i) { printf("Index %s = %s\n", i, buf[i]);}/* Error: */ // P2str = malloc(sizeof(char) * 10);strcpy(str, "Something is wrong");printf("%s\n", printThisOne);/* Error: */ // P3word = "Part 3";*(word + 4) = '-';printf("%s\n", word);/* Error: */ // P4*(integers + 10) = 10;printf("Part 4: %d\n", *(integers +…
- 1. Write the problem anaysis (IPO) in a table based on the c++ coding below. (the image shows the question for the c++ coding) #include <iostream>#define STUDENTS 5#define SCORES 4 using namespace std; void getname(char[]);void getscores(char[],double[]);char calcgrade(double[],double &);void print(char[],double[],char,double); int main(){ char name[STUDENTS][20],letter[STUDENTS],grade;double s1[SCORES],s2[SCORES],s3[SCORES],s4[SCORES],s0[SCORES],avg; getname(name[0]); getscores(name[0],s0); grade=calcgrade(s0,avg);print(name[0],s0,grade,avg);cin.ignore(); getname(name[1]);getscores(name[1],s1);grade=calcgrade(s1,avg);print(name[1],s1,grade,avg);cin.ignore(); getname(name[2]);getscores(name[2],s2);grade=calcgrade(s2,avg);print(name[2],s2,grade,avg);cin.ignore(); getname(name[3]);getscores(name[3],s3);grade=calcgrade(s3,avg);print(name[3],s3,grade,avg);cin.ignore(); getname(name[4]);getscores(name[4],s4);grade=calcgrade(s4,avg);print(name[4],s4,grade,avg); system("pause");…C programming: Stacks. Help fully understand the code below by putting comments. THanks! ... #include<stdio.h> #include<stdlib.h> #include<ctype.h> #include<string.h> int numbers[500], tn=-1, to=-1; char ops[500]; void pushNum(int n) { numbers[++tn] = n; } void pushOp(char ch) { ops[++to]=ch; } int popNum() { return numbers[tn--]; } char popOp() { return ops[to--]; } int precedence(char op){ if(op == '+'||op == '-') return 1; if(op == '*'||op == '/') return 2; return 0; } // this function will perform arithmetic operations. int applyOp(int a, int b, char op){ switch(op){ case '+': return a + b; case '-': return a - b; case '*': return a * b; case '/': return a / b; default: return 0; } } int isOperator(char ch) { return(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='^'); } int evaluate(char exp[200]){ int i,num,output,r; char c; for(i=0;exp[i]!='\0';i++) { c = exp[i];…This is a main module. w7_main Module (supplied) Do not modify this module! Look at the code and make sure you understand it. // Workshop 7 // Version: 1.0 // Author: Asam Gulaid // Description: // This file tests your workshop 7 ///////////////////////////////////////////// #include<iostream> #include "Minister.h" #include "Minister.h" // intentional #include "MemberParliament.h" #include "MemberParliament.h" // intentional using namespace std; using namespace sdds; void printHeader(const char* title) { char oldFill = cout.fill('-'); cout.width(62); cout << "" << endl; cout << "|> " << title << endl; cout.fill('-'); cout.width(62); cout << "" << endl; cout.fill(oldFill); } void newElections(Minister& aMinister, const char* district, const char* newPM, double year) { aMinister.NewDistrict(district); aMinister.changePM(newPM); aMinister.assumeOffice(year); cout << "Status of New Election " << aMinister << endl…