using c++ and use pointer and char(don't use string): Write a class date (d, m, y), class file (name, size, creation_date) and class directory (name, directory_creation_date, array[files]) Write the constuctors, destructors, set, get methods for each class Create a directory object and fill it with its required data
Q: a. How is * used to create pointers? Give an example to justify your answer. b. How is * used to…
A: a.) The asterisk (*) before the variable name denotes that the variable is of pointer type. The…
Q: st, and pointers shall be used in this program. Kindly use only SELECTION, ITERATION, INPUT, AND…
A: #include<iostream> #include<fstream> #include<windows.h> #include<string>…
Q: 3.1 Files can be used to store data permanently. a. List and describe the two types of files that…
A: File handling in C++ is a mechanism to store the output of a program in a file and help perform…
Q: omputer Science Perl Questions Explain what this code is doing: “if(/[a-z]/) { print; } else {…
A: Answer:
Q: Write e python program 5. A company named Sheba.xyz has recently moved from their old domain to a…
A: Input :: ## Calling function def replace_domain( val1, val2, val3='kaaj.com'): old_string = val1…
Q: [Python (py3) code] Using import sys, import stdarray, and import random, create a code that…
A: Matrix is a rectangular arrangement of input values of data or a number or you can say a rectangular…
Q: The code below is given in c++, you need to convert it to C Please make sure after converting the…
A: Given C++ program is for SCAN disk scheduling algorithm which perform the requests in one order to…
Q: Task related to pointers : Write a C++ program to find the max of an integral data set. The program…
A: In this program will ask the user to input the number of data values in the set and each values.…
Q: Write a program-using pointer to display the value and memory address of x? If x = 4d - 2f + 7r
A: No programming language is mentioned in question statement so we will be using c++.
Q: What are the use cases for using the arrays and strings in the programs? List the available string…
A: According to the company guidelines, we can answer only the first question. Please repost the other…
Q: Solve the following C++ question correctly. Implement File handling in C++.
A: Files are basically used to pile up data or we can say save it in a storage device permanently. File…
Q: 1. Given the codes below. Draw a memory layout of pointers and variable(i-ii). What is the output…
A: - : Drawing a layout of pointers and variables : - Given x = 11is a variable, y =20 is a…
Q: 2. Fill in the values indicated by the pointer variable expressions below, based on the following…
A: Given linked list is Double circular linked list. It contains pointers to previous node and next…
Q: C++ performs bounds checking with arrays. When stepping through an array with a pointer, it’s not…
A: The answer is along with the reason and output screenshot
Q: This program demonstrates the use of pointers. What is the output of this program? Assume we know…
A: CODE:- #include <iostream> using namespace std; int main() { int x=25; int *ptr; // pointer…
Q: QUESTION 36 When you work with a dereferenced pointer, you are actually working with O a. a variable…
A: 36. When you work with a dereferenced pointer, you are actually working with the actual value of the…
Q: What is the data type of pointer variables? Suppose that we don‘t know the name of a variable but we…
A: We need to answer the following questions with reference to subject C++ : What is the data type of…
Q: Which of the following is not true of pointers to functions? Select one: a. They contain the…
A: Function pointer is a pointer which points to a function . The function pointer is a variable that…
Q: Which of the following is false for pointer-based strings? Select one: a. A string in C++ is an…
A: In the programming language, we use single quotes to store the character, and we make use of double…
Q: Computer Science Written in C, if I have a global 2d array [256][10] and it is already filled with…
A: #include <stdio.h>// replacee below array to array[256][10]#define row 5#define col 10int…
Q: 3. We've seen variable types that store characters, integers and floating point numbers. In a very…
A: A detailed answer is given below:
Q: Q5 (a) What is the data type of pointer variables? Suppose that we don't know the name of a variable…
A: 1) Pointer datatype Pointer is a variable in that holds the address of another variable. They have…
Q: Problem 8. What is the correct syntax of declaring array of pointers of integers of size 10 in C++?…
A: Given: Problem 8. What is the correct syntax of declaring array of pointers of integers of size 10…
Q: 3. We've seen variable types that store characters, integers and floating point numbers. In a very…
A: Solution: This program creates 4 variables num, c, count, and salary and pointer variables for each…
Q: Which of the following statements are true for ordinary/automatic arrays in C++? (select all that…
A: Actually, array is a collection of elements.
Q: Declare and implement a BSTNode ADT with a data attribute and two pointer attributes, one for the…
A: Actually, program is an executable software that runs on a computer.
Q: using c++: Write a class date (d, m, y), class file (name, size, creation_date) and class directory…
A: #include<iostream.h> #include<conio.h> class Date { public: int day,month,year;…
Q: Read a variable n from the user and generate a series of Fibonacci numbers up to the given n. The…
A: The Fibonacci numbers are the numbers in the following integer sequence.0, 1, 1, 2, 3, 5, 8, 13, 21,…
Q: In the context of C++ and pointers. A pointer is of data type Blank 1 as it holds the address of a…
A: Note: As per student asked I answer the question. Student just asked to fill the blank space. Here i…
Q: Write a C++ function that uses pointer notation only to swap the contents of two integer arrays…
A: Program approach:- // using header file. // using namespace function. // num1 pointer to array1 and…
Q: I need answer of three questions 1.Three of the following expressions have the same value. Which of…
A: 1) Assume A variable that is located at memory location 0xf55 and it contains 46 and assume that ptr…
Q: Assignment (1) Use the operator (&) to print out the memory addresses of the following variables int…
A: Create one C++ program that has following variables, int x=2,*a; char y='c',*b; float z =…
Q: Review these A reference is another name given to a variable in memory of the same data type A…
A: I am writing in comments how each code is executed and finally getting output.
Q: . a) Write a C++ programs that creates a two-dimensional array or table of characters. The number of…
A: Create a char array of 15*15. Fill it randomly and print it to the console.Generate a text file that…
Q: Review these A reference is another name given to a variable in memory of the same data type A…
A: Below I have provided a c++ program for the given question. Also, I have attached a screenshot of…
Q: 2. Write a simple encryption/decryption program. Function encrypt takes a character pointer as a…
A: Find the required code in C++ given as below and output :
Q: Which header file is required in C++ to use OOP? 2. Which feature allows open recursion?
A: Question 1. Which header file is required in C++ to use OOP? Answer 1. OOP can be used without…
Q: In C++, how can one easily duplicate a set of shared pointers into another array? Make a list of…
A: You may discover a wealth of material on smart pointers at C++ Stories - check this particular…
Q: Solve the following C++ Program. you are supposed to DYNAMICALLY create 2 arrays of length 5 using…
A: /*C++ Program for DYNAMICALLY created arrays*/#include <iostream> using namespace std; //main…
Q: use c++ to Implement a city database using a BST to store the database records. Each database record…
A: Actually, given information: c++ to Implement a city database using a BST to store the database…
Q: What happens when you attempt to compile and run the following code? * #include using namespace std;…
A: Q1)#include<iostream> using namespace std; int main() { int x=2.3; cout<<2*x; return 0;…
Q: Write a C++ program to explain the null pointer
A: A C++ program to explain the null pointer
Q: Write a short C program that declares and initializes (to any value you like) a double, an int, and…
A: Solution: Approach: Include necessary header files In the main function Declare and initialize the…
Q: a) Write a C++ programs that creates a two-dimensional array or table of characters. The number of…
A: Create a char array of 15*15. Fill it randomly and print it to the console. Generate a text file…
Q: In Python, how do we sort a dictionary by values, without importing any additional modules? You…
A: 1) we have a dictionary {'a':11,'e':2,'v':32,'c':4} ans we need to sort it by values d =…
Q: code in C# to perform an update
A: Steps to create the program: Declare an array with the original marks. Iterate over the length of…
Q: When variables are declared, are they located in memory contiguously? Write a program with the…
A: If the sequential blocks of memory are available, it will allocate sequentially else it will…
Q: File system implementation: a. Given a flename in a directory’s data block, how does OS locate the…
A: a. Given a filename in a directory's data block, this file name is located by operating system using…
- using c++ and use pointer and char(don't use string):
-
Write a class date (d, m, y), class file (name, size, creation_date) and class directory (name, directory_creation_date, array[files])
Write the constuctors, destructors, set, get methods for each class
Create a directory object and fill it with its required dataFind the size of the created directory object.
Step by step
Solved in 3 steps with 1 images
- Answer the given question with a proper explanation and step-by-step solution. PYTHON PLS!!!!!!!!!!!! In this lab you are asked to complete the recursive function populateDirectory(directory_dict). The function is input a dictionary containing data about the directory file structure and is to be used to populate a MyDirectory object. You are supplied with the classes: MyDirectory and MyFile. Note that file names always have the letter 'f' in the name (e.g. f0.txt). Any other names denote directoriesFor C++, How would I call or use a function that is passed by pointer or a reference? How would I use these in this example below? I understand how passing by value works, but when it comes to passing by references and pointers, that is when I get confused. #include <iostream> using namespace std; // passing by reference in this function void pass_ref(int &ref); // passing by pointer in this function void pass_ptr(int* ptr);What's the distinction between void and NULL pointers? Give appropriate examples to back up your answer. Give the distinctions in TABULAR form.
- What is the data type of pointer variables? Suppose that we don‘t know the name of a variable but we do know its address. Can we access the contents of that variable? Explain briefly. Subject: C++Write in C++. Description: wzip and wunzip class overview: The next tools you will build come in a pair, because one (wzip) is a file compression tool, and the other (wunzip) is a file decompression tool. The type of compression used here is a simple form of compression called run-length encoding (RLE). RLE is quite simple: when you encounter n characters of the same type in a row, the compression tool (wzip) will turn that into the number n and a single instance of the character. Thus, if we had a file with the following contents: aaaaaaaaaabbbb the tool would turn it (logically) into: 10a4b The exact format of the compressed file is quite important; here, you will write out a 4-byte integer in binary format followed by the single character in ASCII. Thus, a compressed file will consist of some number of 5-byte entries, each of which is comprised of a 4-byte integer (the run length) and the single character. To write out an integer in binary format (not ASCII), you…The question should be done in C++, please give explanation and running result. 1. For this question, we need to provide more information about where the mismatch of the text file is happening. Write a recursive function called list_mismatched_lines that takes 2 filenames as input arguments and displays to the screen all mismatched lines in those files. This function should use hashing techniques and shall not compare strings to detect mismatch. The signature of this function should be: void list_mismatched_lines(std::string file1, std::string file2); In file1.txt, it contains "My dear C++ class. I hope that you enjoy this assignment. " In file2.txt, it contains "My dear C++ class. I hope that you like this assignment. " Example: Running the following line of code, should print to the screen the mismatched lines only, from both files. list_mismatched_lines(file1, file2); The following output should be seen on the screen: file1.txt: I hope that you enjoy this assignment.file2.txt:…
- (a) Determine whether the following variable declaration is valid int INT; A Valid B Invalid (b) Determine whether the following variable declaration is valid. int *ptr; A Valid B Invalid (c) Which of the following statement about pointer is TRUE? A. A pointer variable is a variable used tostore an address B.A pointer holds the data, rather thanwhere to find the data C.The unary operator & is used to find anobject's value D.The unary operator * is used to find an object's addressWrite a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ...Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ... # Put your code here import os #module used to interact with operating system def displayFiles(pathname): #recursive function that takes a pathname as argument if (os.path.isdir(pathname)): #checks if specified path (argument) is an existing directory #for item in os.listdir(pathname): for content in os.listdir(pathname): #gets the list of all files and directories in the directory and…
- a. How is * used to create pointers? Give an example to justify your answer. b. How is * used to dereference pointers? Give an example to justify your answer.Write a C++ Program using classes, functions (recursive and otherwise), arrays and other C++ commands where a user enters the name of a file and the program calculates the amount of vowels (a,e,i,o,u -lower case and A,E,I,O,U - UPPER CASE, separately!), the letters y, Y, ñ, Ñ, and punctuation marks in the file. You can use the Loren Ipsum generator online for a test file: https://es.lipsum.com/If a pointer is not pointing anywhere, it’s recommended you have it point to nothing. This is accomplished using NULL in C, as with int *p = NULL Why do you think that is a good idea? Explain your answer.