In the source file (CPP), create a C++ class that contains your functions and data members as follows: • Data members: · 2 arrays of strings named names and values respectfully (do not use STL containers e or your score will be reduced significantly). The size of the arrays should be large enough to hold all of the data parsed from the test files (we will be modifying this in the future so don't worry about the size being just right. Err on the side of too large if anything). • names array: will contain all of the names in the object values array: will contain all of the values in the object Member functions:
Q: Function: get_total_cases() takes the a 2D-list (similar to database) and an integer x from this…
A: According to the information given:- We have to create get_total_case() function to get 2D list of…
Q: write a program in C++ that allows the user to enter 10 songs and their artists into a playlist and…
A: The code is written below- #include <iostream> #include<string> #include<cstdio>…
Q: Look at the code below and use the following comments to indicate the scope of the static variables…
A: Scope of variables and functions: Scope of variables and functions are an identifier, that…
Q: Each function (function name plotNegXSquaredPlus25) should accept two integer parameters indicating…
A: Below is the compiled code in java. In the below step you can find the running code and output.…
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Source Code: 1. printMeFirst.h For copy #include<iostream>using namespace std; void…
Q: Class: Desk Data members: weight (integer) Write all external function definition required to make…
A: #include <iostream>using namespace std;class Desk{ public: int weight;…
Q: In C++ please and in a manner I can copy and paste the code. Thanks You are to create a class…
A: //-------------- animal.h ------------#ifndef __ANIMAL_H#define…
Q: Implement a function writeEmpToFile that takes two arguments: a struct Employee pointer and a FILE…
A: Answer is given below. Read carefully. Thank you......
Q: Implement a function writeEmpToFile that takes two arguments: a struct Employee pointer and a FILE…
A: The Answer is
Q: You are working for a university to maintain a list of grades and some related statistics for a…
A: According to the information given:- We have to create c++ program to maintain a list of grades and…
Q: You are given two files mystring1.h download and mystring1.cpp download which defines a String…
A: Answer: //File: mystring2.h// ================// Interface file for user-defined String class.…
Q: Please answer in c++. Create a template class UniversalArray which createss an array of a given…
A: The code with explanation as well (in comments) is given below. Please note that the main idea of…
Q: Which of the following is part of the library header file? (Check all applicable answers)…
A: As per guidelines, we are supposed to answer only one question. Kindly repost other question as a…
Q: Use pointer. Write a function named “hasHelpOption”that accepts argc and argv (same data typesof…
A: Use strcmp for string comparison and it returns 0 if both are same
Q: Average the numbers between the iterators.
A: vectors are like containers in c++ it is use to store elements . vector is a template class designed…
Q: Which of the following statements regarding templates and STLS is correct? You can only have one…
A: While doing programming in any programming language, you need to use various variables to store…
Q: (A) When you create two object stacks of the same type, they are considered equal if they satisfy…
A: The solution for the above given question is given below:
Q: Please answer in c++. Create a template class UniversalArray which createss an array of a given…
A: Solution :: The program code to copy is provided along with the program code screenshots and the…
Q: Assume there is a need to design a stock-control program for drugs used due to COVID-19 pandemic at…
A: the code is an given below : // emudrugstore.h #ifndef EMUDRUGSTORE_H#define EMUDRUGSTORE_H…
Q: Create a C++ Function Template named swap so that it has two parameters of the same type. A Template…
A: #include <iostream>using namespace std;//templated function declarationstemplate<class T…
Q: In the source file (CPP), create a C++ class that contains your functions and data members as…
A: Below i have answered:
Q: Write a C++ function (along with the helper functions) that returns the maximum number in a list of…
A: maxFileNum() directly takes the istream object as argument, and we are to assume that numbers.txt is…
Q: Develop a C++ program that reads the student’s name and scores from the attached data file…
A: HELLO STUDENT HOPE YOU DOING WELL I WILL PROVIDE THE FULL CODE PHOTOS HERE IN NEXT STEPS
Q: Make a new DevC++ project named “yourID_InitialsofYourName_P9_Q3”. Write your own two-dimensional…
A: File name: "twoD.h" #ifndef twoD_H #define twoD_H //Function declarations void input(int **td, int…
Q: Suppose that you have the Object class Employee which is an object that contains Name, Surname and…
A: The program for the above given question is below:
Q: Write a function which accepts an int array and the number of elements in the array as two…
A: Required C++ function for above : //required function int *counter(int a[], int size){ int…
Q: Create a generic function sum that takes two integer/double numbers as paramet and prints the sum.…
A: We need to define a generic method that accepts a subclass of Number as parameters and compute the…
Q: Create organized functions with the single lines of code by declaring the functions, calling the…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Lab9: Structure & Makefile CS-102 2020 Fall Semester This lab will explore how to define a new C++…
A: CODE: printMeFirst.h For copy #include<iostream>using namespace std; void…
Q: 6. Write a Python function named num_vowels_consonants that is passed a string containing letters,…
A: As per company guideline, I am solving only one question, because these are not interlinked. Please…
Q: IN C++ The text file is the 5 lines below 1 1 1 1.2 -2.3 0.4 -2 -3 -4 +0 -2 8.85 2.345…
A: 1 1 1 1.2 -2.3 0.4 -2 -3 -4 +0 -2 8.85 2.345
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Actually, program is an executable software that runs on a computer.
Q: IN SCALA COULD YOU COMPLETE THE FOLLOWING FUNCTIONS: // Regular Expressions abstract class Rexp…
A: def nullable (r: Rexp) : Boolean = r match { case NULL => false case EMPTY => true case…
Q: Write a function named read_file() that reads the content of a text file (similar to the one…
A: The solution for the above given question is given below:
Q: s from the ARROVER3 program in Chapter 8 of Object Orient programming by Rober Lafore. Make this…
A: THIS QUESTION IS RELATED TO SUBJECT OBJECT ORIENTED PROGRAMMING IN C++ . SOLVE this question in dev…
Q: rallel arrays and range matches for this application. 1. Declare variables with proper data types…
A: using System;using System.Collections.Generic;class HelloWorld{ static void Main () {…
Q: Write a complete C# console application in which you will have to store data of Employee in 1…
A: Program approach:- Create an employee array. Function to input employee details. Method to display…
Q: Mr.John, sales manager. He wants to store the list of items that were ordered by customers and he…
A: I have implemented the given requirements in C++ as per the instructions given. Comments are…
Q: Write a function that takes (i) a FILE pointer (e.g. FILE *fp) type variable, (ii) an array of…
A: Write a function that takes (i) a FILE pointer (e.g. FILE *fp) type variable, (ii) an array of…
Q: Mr.John, sales manager. He wants to store the list of items that were ordered by customers and he…
A: The code is as follows: #include <iostream> #include <string> #include <list>…
Q: In C++ Define a class called textLines that will be used to store a list of lines of text (each…
A: Step 1 The code is given in the below step Sometimes copy and paste won't work so please type the…
Q: This lab will explore how to define a new C++ data type and also how to combine multiple C++ files…
A: Actually, program is an executable software that runs on a computer.
Q: Activity 7: Shapes (I/O operator overloading) In this program, you must implement I/O operator…
A: We need to update the definition of the Triangle and Square classes to add the declaration of the…
Q: Income tax department generates the password for Incometax return file using the following procedure…
A: program: import java.util.*; import java.io.*; public class con { public static void main(String[]…
Q: Write a C++ program in this new file. In this new file, write code that will do the following:…
A: #include<iostream>#include<cmath>//for sqrtusing namespace std;//defining…
Q: FileAttributes.c 1. Create a new C source code file named FileAttributes.c preprocessor 2.…
A: FileAttributes.c 1. Create a new C source code file named FileAttributes.c preprocessor…
Q: C++ Write a function named “checkInvalidHours” that accepts an array of PaySub objects and its…
A: The solution in C++ is as follows for size of 5.We can change the size as per our requirement
Q: Implement the following functions. Each function deals with null terminated C-Style strings. You can…
A: Here, I have to provide a solution to the above question.
Q: Write a function named “hasHelpOption”that accepts argc and argv (same data typesof command line…
A: bool hasHelpOption(int argc,char **argv){ for(int i=0;i<argc;++i) {…
In C++ create a JSON parser, please leave meaningful comments explaining parts of the code.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Implement the following functions. Each function deals with null terminated C-Style strings. You can assume that any char array passed into the functions will contain null terminated data. Place all of the functions in a single file and then (in the same file) create a main() function that tests the functions thoroughly. You will lose points if you don't show enough examples to convince me that your function works in all cases. Please note the following: You may not use any variables of type string. This means that you should not #include <string>. Also, you may not use any c-string functions other than strlen(). If you use any other c-string functions, you will not get credit. Note, however, that functions such as toupper(), tolower(), isalpha(), isspace(), and swap() are NOT c-string functions, so you can use them. Also note that this prohibition is only for the functions that you are assigned to write. You can use whatever you want in your main() function that tests the…in c++ Write a function named createTwoNames that will do the following: - Read in a word and its definition - Create the Word object for that word and definition - Read in an item’s name and its price - Create the Item object for that item - It will return an array of two pointers pointing to these newly created Word and Item objects. It will use try-catch statement to handle the exception. If the user enters an empty or all-blank word or definition or item’s name, it will not create the object(s) and return null for that object only. In another words, it may create 0, 1 or 2 objects. Whenever the error occurs, it must print out the correct error reason: empty or blank (but not both). Note that this function can and will use cin and cout to read in values from the user.Write a complete C# console application in which you will have to store data of Employee in 1 dimensional array. Employee contains eid(int), name(string), department (string), gender (char) and salary (int) as properties. Size of array must be user defined. You have to perform the following: 1.Input data in array. 2.Display data of highly paid female Employees 3.Pass the given array to function, so that it will return count of those employees whose department is IT. 4.Pass the given array to function, so that it will return an array of employees working in IT department.
- Write a void function that reads a file “a:data.txt” with up to 35 student ids, names and final marks into 3 arrays. When the student name is "quit" stop processing or if 35 array elements have been read then stop processing . The function should return the length of the actual number of students as well as the 3 arrays. In main, show all declarations and show the actual call. You can use the following prototype and data file: (note that in this case length would be 4) const int SIZE = 35; void ReadData( string name[],int id[], int mark[], int& length); data.txt Bob 123456 89 Suki 234567 77 Felix 345678 55 Julie 456789 67 quit in c++ please use basic coding I'm not advancedYou are given two files mystring1.h download and mystring1.cpp download which defines a String class (noted that upper case S, C++ is case sensitive) implemented by using static array as the data member. The purpose of this is to rewrite this class by replacing the static array with a pointer (dynamic array). You are required to modify the String class accordingly: Data: we wish to allow our String class to accommodate strings of different sizes. To that end, instead of storing a string’s characters in a fixed-size array, each String object should contain the following data as part of its internal representation: (1) a character pointer meant to point to a dynamically allocated array of characters. (2) a length field that will hold the current length of the string at any given moment. Operations: same as the methods in String class, plus the “big three”( destructor, copy constructor, and assignment operator overloading). Modularity: The String class code must be put in its own…Which of the following statements is NOT correct? Group of answer choices C++ language provides a set of C++ class templates to implement common data structures, which is known as Standard Template Library (STL); In STL, a map is used to store a collection of entries that consists of keys and their values. Keys must be unique, and values need not be unique; In STL, a set is used to store a collection of elements and it does not allow duplicates; Both set and map class templates in STL are implemented with arrays.
- Create organized functions with the single lines of code by declaring the functions, calling the function, then defining the function. Please help me make this look cleaner... The code should operate the same. C++ #include <iostream>#include <vector>#include <string>#include <ctime>using namespace std; int main(){srand(static_cast<unsigned int> (time(0)));const int N = 4;string wordP[N] = { "engineer","cooper union", "final", "new york university" }; for (int i = 0; i <= N; i++) {cout << wordP[i]<< endl;} label: int z = rand() % N;string word = wordP[z];string scrambled = word; const int rp = scrambled.size(); for (int letter = 0; letter < rp; letter++) { int z = rand() % rp;char game = scrambled[z];scrambled[z] = scrambled[letter];scrambled[letter] = game;} unsigned int t1 = time(0); string begin;do {cout << "Lets play a game.." << endl << " Unscramble the following words in order to proceed" << " "…In C++, create a class for a 3-dimensional array. To make it more general, allow the actual dimensionality to be 0d, 1d, 2d, or 3d. It should support indexing with operator(). If the programmer subscripts with fewer indices than you 'need' (0 for a 1d, 0 or 1 for a 2d, 0 or 1 or 2 for a 3d -- note that you can't under-subscript a 0d array), you should return the appropriately sized sub-array (of your class's type). (Note: This will require multiple overloads of operator() with different numbers of index arguments.) Since, as a template, math operations don't make sense, you'll have to for-go addition, etc. But you could use + and += for concatenation. Basically aligning the common dimensions of the two arrays and concatenating along the remaining dimension. (There can be only one for this to make sense. If there are none remaining, there are options for those kinds of things!) Make sure to overload it for proper dimensionality: Of course, you should also support input (the programmer…In C++ Define a class called textLines that will be used to store a list of lines of text (each line can be specified as a string). Use a dynamic array to store the list. In addition, you should have a private data member that specifies the length of the list. Create a constructor that takes a file name as parameter, and fills up the list with lines from the file. Make sure that you set the dynamic array to expand large enough to hold all the lines from the file. Also, create a constructor that takes an integer parameter that sets the size of an empty list. Write member functions to: remove and return the last line from the list add a new line onto the end of the list, if there is room for it, otherwise print a message and expand the array empty the entire list return the number of lines still on the list take two lists and return one combined list (with no duplicates) copy constructor to support deep copying remember the destructor!
- 6. Write a swap function, that swaps the values of two variables in main, but usepointers instead of reference parameters.7. Write a function that takes an array of ints and its size as arguments. It shouldcreate a new array that is the same size as the argument. It should set the values inthe new array by adding 10 to each element in the original array. The functionshould return a pointer to the new array. (Make sure you use dynamic memoryallocation) can i get answers for this two sub parts. thanksIn C Programming: You will need all the functions from the previous assignment, as well as the structure course:• Department (string, 15 characters)• Course number (integer, 4 digits, leading 0 if necessary)• Course title (string, 30 characters)• Credits (short, 1 digit) Write a function saveAllCoursesText() which receives an array of course pointers and the array’s size, then outputs the content of the array in text format to a file named “courses.txt”.• Save the entire structure on 1 line (all the members of the structure should be saved in 1 fprintf() command)Create a C++ Function Template named swap so that it has two parameters of the same type. A Template Function created from swap will exchange the values of these two parameters. Create a C++ Function Template named multiples so that it has three parameters sum, x, and n. The first two parameters will have the type represented by the function template type parameter WhatKind. n will always be int. The return type is void. All parameters are passed by value except for sum which is passed by reference. A Template Function created from multiples will compute... sum = 1 + x + 2x + 3x + ... + nx Create a C++ Class called Mathy that also contains these two functions and that is properly templatized. Write code in your main function to demonstrate that each function works well individually and when used from within the class using multiple types. Demonstrate that you achieve the same results using both the templatized class and functions.