Computer Science Question
Q: #include #include #include using namespace std; struct Student{ string firstName; string…
A: 1st error: You close the class before the gpacalculation function so that’s why code shows the…
Q: // FILE: DPQueue.h // CLASS PROVIDED: p_queue (priority queue ADT) // // TYPEDEFS and MEMBER…
A: The implementation of the pop() function in the provided DPQueue.h header file consists only of an…
Q: }; private: AeroCar(double new height, double new_speed); const; { void display_data() AeroCar::…
A: C++ is an object-oriented generic programming language for creating software, and it is a…
Q: Copy the completed Assignment 1 to Assignment 2. Re-label comments as needed. Add this feature to…
A: The complete code is given below with output .
Q: Implementing the Customer Class We've partially defined the Customer class for you in "customer.h"…
A: Create a Customer class with member variables for the name of the customer, the number of products…
Q: Write a program that takes the tree created in PRG-1 and remove the two data items 37, and 54 and…
A: The given program is a C++ code that creates a binary tree and traverses it using inorder, preorder,…
Q: #include #include "ContactNode.h" int main() { ContactNode* contactList = new ContactNode();…
A: The source code of the program #main.cpp #include <iostream>#include "ContactNode.h"int…
Q: public void enableselectors() { // need help -- make this code actually enable or disable the…
A: The ask is to build the enable and the disable methods for the map of selectors of Category object…
Q: C++ Program #include #include #include using namespace std; int getData() { return…
A: Actually, program is a executable software that runs on a computer.
Q: myString. h: #include using namespace std; #ifndef _MYSTRING_H_ #define _MYSTRING_H_ class…
A: C++ Programming :- C++ is a cross-platform language that can be used to create high-performance…
Q: Modify the given code to accept float instead of int as a coefficient in C LANGUAGE: // Node…
A: Given that modify the given code to accept float instead of int as a coefficient in C LANGUAGE:…
Q: c++ computer language what is the output of the following code segment? int main() { int…
A: Given C++ Program: #include <iostream>using namespace std;void sub(int arr[], int z) { for(int…
Q: ANSWER BANK Move the necessanry blocks over into the response area: delete () temp; char" temp-…
A: Below is the given data from 2nd image [1 temp; char" temp = this-value; strcat(this->value,…
Q: string txt = "Noor"; cout 1: . "The ;. .length of the txt string is: " >
A: Ans. txt.length();
Q: #include #include #include using namespace std; // structure struct Hat { string brand; string…
A: Actually, program is an executable software that runs on a computer.
Q: // prototype of DelOddCopEven of Assignment 5 Part 1 #endif // definition of DelOddCopEven of…
A: Linked List which refers to the one it is that each of its node contains a reference to the next…
Q: #include using namespace std; struct Triple { int row, col, value; }; class Matrix; class…
A: Since you are asking multiple questions, we are doing first question only, if you want solution of…
Q: #include using namespace std; struct Triple { int row, col, value; }; class Matrix; class…
A: Matrix : Matrix in C++ contains rows and columns to solve various problems like solving…
Q: 1. Draw a dfa of L/L2 for L1 {a"b" : n 2 1, m 0}U{ba} L2 {b"aa : m 2 0}
A: DFA is also known as deterministic finite automata.
Q: Hello i keep getting this error?? im not user where i went wrong? it just keep added more? thank you
A: #include <stdio.h> # include <stdlib.h> int input(); void multiples(); void coins();…
Q: void showLinked() Linked_List "p; p=List; while(pl-NULL) coutname agephoneNOID_NOnext; } cout>k;…
A: #include <bits/stdc++.h> using namespace std; class Node { public: int data; Node *next;…
Q: 1. Design and instantiate a structure which has 2 fields: color (line color), positions (positions…
A: DefinitionsTo use a particular circle and rectangle picture many times, it’s simpler to give them…
Q: mkfifo("mypipe"); if (!fork()) { fp popen("echo 37 > mypipe", "w"); status = pclose(fp); } else {…
A: First of all the program creates a pipe named mypipe. After that the fork() command is executed.…
Q: function removeErrMsgs() { var errMessages = document.getElementsByClassName('msg'); for (let msg…
A: function removeErrMsgs() { var errMessages = document.getElementsByClassName('msg');for (let msg of…
Q: Find logic errors: #include #include #define NEOS 8 #define NPX 10 #define AVGS 100 int…
A: Logic error : In PC programming, a logic error is a bug in a program that makes it work erroneously,…
Q: İn C Language pls help #include #include #include <string.
A: The code is given below
Q: Using the code source screenshot (C++) explain in depth what each line of code does.
A: #include <iostream>#include <cstdlib>using namespace std;// this is node struct with…
Q: Two integers, babies 1 and babies2, are read from input as the number of babies of two turtles.…
A: Here is your solution step by step -
Q: 2.20 LAB: Hypotenuse Given two numbers that represent the lengths of a right triangle's legs (sides…
A: Introduction: The name "Hypotenuse" in mathematics derives from the Greek word hypoteinousa, which…
Q: when i run my code why does it keep add more cents when e.g? 30 cent50 : 2 cent20 : 5 cent10 : 1…
A: //// main.c// Assignment1//// Created by Hassan omer on 15/10/21.// #include <stdio.h>…
Q: ifndef NODES_LLOLL_H #define NODES_LLOLL_H #include // for ostream namespace…
A: The code provided defines a linked list of linked lists (LLoLL) using two struct definitions: PNode…
Q: #include #include #include #include using namespace std::chrono; using namespace std; void…
A: Start by including the necessary header files for input/output operations (<iostream>), random…
Q: complete and create magical square #include using namespace std; class Vec { public: Vec() { }…
A: #include <iostream> using namespace std; class Vec { public: Vec() { } int size() { return…
Q: --> x - linspace (-20, 20,1000); --> yl - x. *sin (x); --> y2 - -x3; > plot (x, y1, 'b',x, y2, 'r');…
A: # importing libraries import matplotlib.pyplot as p import numpy # defining x and y axis x =…
Q: In C, using malloc to allocate memory for a linked list uses which memory allocation scheme? O Heap…
A: Here in this multi part question.in the first part we have asked that in c using malloc to allocate…
Q: C++ Program #include #include #include using namespace std; int getData() { return…
A: Actually, program is a executable software that runs on a computer.
Q: Implementing the Customer Class We've partially defined the customer class for you in "customer.h"…
A: #include <memory>#include <string>class Customer {public:// ====================== YOUR…
Q: 4.What is the function of tag ?
A: Comment Tag: Comment tag is used to insert comments in the source code which can help to understand…
Q: #include #include #include #include using namespace std::chrono; using namespace std; void…
A: Below I am attaching a code for all file: 1 VectorAdd.cpp 2 ParallelVectorAdd.cpp
Q: create a uml diagram with this code: class Divisible: def div(minr, maxr, div1, div2):…
A: In the above code, the following activity is done: Start Input minr and check its validity. If…
Q: #include using namespace std; struct item { int id; float price; } s[50]; int size=0;…
A: Algorithm: for (initialExpression; testExpression; updateExpression){ // body of the…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- #ifndef LLCP_INT_H#define LLCP_INT_H #include <iostream> struct Node{ int data; Node *link;};void DelOddCopEven(Node*& headPtr);int FindListLength(Node* headPtr);bool IsSortedUp(Node* headPtr);void InsertAsHead(Node*& headPtr, int value);void InsertAsTail(Node*& headPtr, int value);void InsertSortedUp(Node*& headPtr, int value);bool DelFirstTargetNode(Node*& headPtr, int target);bool DelNodeBefore1stMatch(Node*& headPtr, int target);void ShowAll(std::ostream& outs, Node* headPtr);void FindMinMax(Node* headPtr, int& minValue, int& maxValue);double FindAverage(Node* headPtr);void ListClear(Node*& headPtr, int noMsg = 0); // prototype of DelOddCopEven of Assignment 5 Part 1 #endifdef count_odds(values): 695 >>> count_odds([[111, 165, 207]]) [3] >>> count_odds([[1, 2], [8], [5, 6, 7]]) [1,0, 2] 695// FILE: DPQueue.h// CLASS PROVIDED: p_queue (priority queue ADT)//// TYPEDEFS and MEMBER CONSTANTS for the p_queue class:// typedef _____ value_type// p_queue::value_type is the data type of the items in// the p_queue. It may be any of the C++ built-in types// (int, char, etc.), or a class with a default constructor, a// copy constructor, an assignment operator, and a less-than// operator forming a strict weak ordering.//// typedef _____ size_type// p_queue::size_type is the data type considered best-suited// for any variable meant for counting and sizing (as well as// array-indexing) purposes; e.g.: it is the data type for a// variable representing how many items are in the p_queue.// It is also the data type of the priority associated with// each item in the p_queue//// static const size_type DEFAULT_CAPACITY = _____// p_queue::DEFAULT_CAPACITY is the default initial capacity of a// p_queue that is created by the default…
- >> IN C PROGRAMMING LANGUAGE ONLY << COPY OF DEFAULT CODE, ADD SOLUTION INTO CODE IN C #include <stdio.h>#include <stdlib.h>#include <string.h> #include "GVDie.h" int RollSpecificNumber(GVDie die, int num, int goal) {/* Type your code here. */} int main() {GVDie die = InitGVDie(); // Create a GVDie variabledie = SetSeed(15, die); // Set the GVDie variable with seed value 15int num;int goal;int rolls; scanf("%d", &num);scanf("%d", &goal);rolls = RollSpecificNumber(die, num, goal); // Should return the number of rolls to reach total.printf("It took %d rolls to get a \"%d\" %d times.\n", rolls, num, goal); return 0;}Help me fix my c programming error. #include <stdio.h>#include <stdlib.h>#define _CRT_SECURE_NO_WARNINGS void addContact();void viewContact();char firstName();char lastName();char phoneNumber[10]; int main(){int selection;printf("\n\t---Contact Mangement System--");printf("\n\t[1] Add New Contact");printf("\n\t[2] View Contact");printf("\n\t[3] Help");printf("\n\t[4] Exit");printf("\n\tEnter Your Selection");scanf("%d", selection);switch (selection){case 1:addContact();break;case 2:viewContact();break;case 3:exit(1);break;default:printf("Enter Your Selection");main();}}void addContact();{printf("Enter First Name: ");scanf("%s", firstName);printf("Enter Last Name: ");scanf("%s", lastName);printf("Enter Your Phone Number: ");scanf("%s", phoneNumber);if (strlen(phoneNumber) == 10){FILE* fp;fp = fopne("contacts.txt", "w");fputs(firstName, fp);fputs(lastName, fp);fputs(phoneNumber, fp);printf("\n\tContact Added");fclose(fp); } main();} void viewContact(){system("cls");char…#include <iostream>#include <cstdlib>using namespace std; class IntNode {public: IntNode(int dataInit = 0, IntNode* nextLoc = nullptr); void InsertAfter(IntNode* nodeLoc); IntNode* GetNext(); void PrintNodeData(); int GetDataVal();private: int dataVal; IntNode* nextNodePtr;}; // ConstructorIntNode::IntNode(int dataInit, IntNode* nextLoc) { this->dataVal = dataInit; this->nextNodePtr = nextLoc;} /* Insert node after this node. * Before: this -- next * After: this -- node -- next */void IntNode::InsertAfter(IntNode* nodeLoc) { IntNode* tmpNext = nullptr; tmpNext = this->nextNodePtr; // Remember next this->nextNodePtr = nodeLoc; // this -- node -- ? nodeLoc->nextNodePtr = tmpNext; // this -- node -- next} // Print dataValvoid IntNode::PrintNodeData() { cout << this->dataVal << endl;} // Grab location pointed by nextNodePtrIntNode* IntNode::GetNext() { return this->nextNodePtr;} int IntNode::GetDataVal() {…
- #include <iostream> #include <cmath> #include <iomanip> using namespace std; int calc_qty(int qty); void receipt( int qty, int qty2); int calc_qty(int qty); void coffee_size(int qty, int size, int choice, int qty2); void slices(); void beanounces(); int main() { int qty = 0, order = 0, size = 0, qty2 = 0; receipt (qty,qty2); calc_qty (qty); do { //displays the menu cout<<" Please select an item on the menu you would like to buy."<<endl; cout<<"Enter 1 for Coffee\n"<<"Enter 2 for cheese cake\n"<<"Enter 3 for coffee beens\n"<<endl; cin>>choice; } switch (choice) { case 1: coffee_size(qty, size, order, qty2); break; case 2: slices(); break; case 3: beanounces(); break; case 4: cout<<"Enjoy your day"<<endl;…WAP c# program creates a string, s1, which deliberately leaves space for a name, much like you’d do with a letter you plan to run through a mail merge. We add two to the position where we find the comma to make sure there is a space between the comma and the name.#ifndef INT_SET_H#define INT_SET_H #include <iostream> class IntSet{public: static const int DEFAULT_CAPACITY = 1; IntSet(int initial_capacity = DEFAULT_CAPACITY); IntSet(const IntSet& src); ~IntSet(); IntSet& operator=(const IntSet& rhs); int size() const; bool isEmpty() const; bool contains(int anInt) const; bool isSubsetOf(const IntSet& otherIntSet) const; void DumpData(std::ostream& out) const; IntSet unionWith(const IntSet& otherIntSet) const; IntSet intersect(const IntSet& otherIntSet) const; IntSet subtract(const IntSet& otherIntSet) const; void reset(); bool add(int anInt); bool remove(int anInt); private: int* data; int capacity; int used; void resize(int new_capacity);}; bool operator==(const IntSet& is1, const IntSet& is2); #endif
- Transcribed Image Text #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> int i; char n=1,username[16],password[ 30],ch; void welcome() { system ("@cls||clear"); printf("\t\tWECOME TO MY SITE\n"); } int main() { while(n<=3) { welcome(); printf("\n\NLOGIN HERE!"); printf("\n\nUSERNAME : "); scanf ("%s",&username); printf("PASSWORD: "); for (i=0;i<16;i++) { ch = getch(); if(ch==13) { password[i]='\0'; break; password[i]=ch; printf("*"); password[i]='\0'; printf("\n\n"); system("pause"); if(strcmp(username, "rolan")==0) if(strcmp(password, "12345")==0) { welcome(); printf("\n\NYOU'VE LOGIN SUCCESSFULLY!"); break; else welcome(); printf("\n\nWRONG PASSWORD. You have %d attempt/s left...",3-n); else welcome(); printf("\n\NUSER DOESN'I EXIST. You have %d attempt/s left...",3-n); getch(); n++; if(n==4) { welcome(); printf("\nSORRY! YOU CAN'T LOGIN."); break; getch(); } }write the UMLclass diagram #include<iostream>#include<string> using namespace std; const int maxrow = 10; string ChickenriceQuantity[maxrow] = {};string ChickenriceType[maxrow] = {};string search(); class Chickenrice{ public: string ChickenriceQuantity[maxrow]; string ChickenriceType[maxrow]; void DisplayMenu(); void AddRecord(); void DeleteRecord(string search); void ShowRecord(string search); void DisplayAllRecord(); }; int main(){ std::cout<<"MENU\n"; int option; system("CLS"); Chickenrice rice; do{ cout<<"1-Display menu"< cout<<"2-Add details"< cout<<"3-Delete details"< cout<<"4-View all list of chicken rice"< cout<<"5-View selected chicken rice record"< cout<<"6-EXIT"< cout<<"Select OPTION"< cin>>option; switch(option) { case 1: { rice.DisplayMenu();…int cal_media() {cout<<"Enter Your Name"<<endl;cin>>name;cout<<"Enter the Both subject marks"<<endl;cin>>marks1>>marks2;totalmarks = marks1 + marks2;} Question 4: On above code overload unary operator prefix decrement and post fix increment forthe calc-media() function.