Take a look at the following class here in c++.. class myDocument { public: myDocument(const char *docname); ~myDocument(); void print(); create an object for the above class that will opens a .txt file and remains open. utilize method print() to output the text in the .txt file to the screen.
Q: public class RandomNumbersWithASeed { // The specified seed public static final int SEED = 146; // T...
A: Modified code: import java.util.*;public class RandomNumbersWithASeed { public static final int S...
Q: Your organisation wants to shift away from utilising desktop apps and instead use services to access...
A: Organization shift away from utilising desktop apps , instead using services to access same function...
Q: In Python, create a function called function(A) that returns all of the following: - the steady-stat...
A: the steady-state gain of A as a scalar (if it exists, else the string 'DNE' if does not exist): def ...
Q: Write a program that reads from a student his/her name and his/her ID which is formed of 8 digits. T...
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the...
Q: C Address filtering. How you would bypass MAC address filteri
A: MAC Address filtering
Q: What are the measures that can be taken by individuals and organizations to minimize the invasion of...
A: INTRODUCTION: Here we need to tell the measures that can be taken by individuals and organizations t...
Q: Write a program that print the following on the screen. Java Java Java Java Java Java Ja...
A: Java Code for above output is below:
Q: a Moral Issue on online platform Have you experienced on some of these online platform? How did you ...
A: Infrastructural Problems Though online learning doesn’t require huge buildings, big classrooms, ch...
Q: What other variables may be changed to keep the page size the same (and so avoid software rewrite)? ...
A: Introduction: To maintain the same page size, the following factors were altered:
Q: Explain what a "compensation action" is and why these activities may need ncluded in workflows using...
A: "compensation action" is and why these activities may need to be included in workflows using an exa...
Q: Several techniques have been proposed for a processor capable of decrypting encrypted data and syste...
A: Introduction: A central processing unit, often known as a central processor, main processor, or simp...
Q: Code for Greedy NFA Interpretation (Terminates on Failur
A: Code for Greedy NFA Interpretation (Terminates on Failure)
Q: Explain why distributed software systems are more difficult than centralised software systems, which...
A: Distributed systems: Distributed system is a environment in which various components are spread acr...
Q: Asap. 4. Define a method in JAVA that should take 4 numbers as the parameters and returns the averag...
A: Given: Define a method in JAVA that should take 4 numbers as the parameters and returns the average ...
Q: What are the advantages of using a non-blocking caching system? Computer science
A: Introduction: The following are the benefits of utilizing a non-blocking caching system: What are t...
Q: Make a suggestion on how the SimplelnterestCalculator service could be made RESTful.
A: We need to discuss, how the interest service calculator may be made restful.
Q: What is the best way to set up EIGRP named mode?
A: Introduction: Within EIGRP named mode, there are address-family configuration modes (i.e. the virtua...
Q: Convert NFA to Regular expression : q0 is the start and q2 is the final state δ(q0,a lamda) = q1, ...
A: Note - I used Y for lambda.
Q: What is the difference between a subsystem and a logical subdivision, and why is it important?
A: Introduction: The blocks are logically divided at the common plate joints. Arrows pointing inwards i...
Q: Your organisation wants to shift away from utilising desktop apps and instead use services to access...
A: While shifting the apps to the remotely instead of services, there might be many potential danger, l...
Q: In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval Will Bob necessa...
A: The answer as given below:
Q: Using examples, define a real-time operating system. Explain how it differs from a typical operating...
A: Real-Time Operating System A Real-Time Operating System, or RTOS, is a software component that rap...
Q: What advantages does a file system website have over a website that uses the http protocol?
A: Introduction: This query is based on a comparison between the file system and the http protocol. The...
Q: Code for Greedy NFA Interpretation (Terminates on Failure
A: Below the Code for Greedy NFA Interpretation (Terminates on Failure)
Q: 2. Sometimes, passing by value is called passing by __________. a) copy b) argument c) address ...
A: Sometimes, passing by value is called passing by argument Passing by reference implies the called fu...
Q: Write a Python program to take a string that contains a single pair of parenthesis, print the new st...
A: The solution to the given problem is below.
Q: Using C++ and MPI Using more than 2 processes, create a program that sends the same message sequent...
A: Solution Detail solution in c language:- // Using C language create an MPI program: Using more than ...
Q: 8. A 10-bit counter, clocked with an input frequency of 512 kHz, runs continuously. Every time it ov...
A: here we calculate the frequency of interrupt stream by using the given information , so the calculat...
Q: b) x(t) -6 3 4 6 . -3 -2
A: Matlab code for Fourier Seriesclear allclose all%Question a.%function for which Fourier series have ...
Q: 2. Explain any two structures of Operating Systems Services.
A: PROCESS MANAGEMENTA process is a program in execution: (A program is passive, a process active.)A pr...
Q: What is the output of the following program? void display(int n) {if (n<10) {display(n+2); cout ...
A: Here there is a void function called display having integer as parameter. According to the given que...
Q: In Google App Engine, how are static and resource files stored and accessed?
A: Intro Distributed storage can have static resources for dynamic web applications. The advantages of...
Q: Void methods can accept arguments. O True O False
A: We are going to learn if void methods can accept arguments.
Q: Should software engineers who work on safety-related system definition and development be profession...
A: Typical formal definitions of software engineering are: "research, design, develop, and test operat...
Q: 7. Consider the CFG S-> SS+ISS*la. Derive the string aa+a* from the given CFG and construct between ...
A:
Q: Explain what a "compensation action" is and why these activities may need to be included in workflow...
A: Let's see solution what's compensation action
Q: I'm wondering about the distinctions between commercial and personal cloud service providers. Examin...
A: Intro Data Storage Management: Cloud service providers must accomplish data storage management and ...
Q: Analyze the impact of 3D Printing in a global context
A: INTRODUCTION: Here we need to tell the impact of 3D Printing in a global context.
Q: WHERE CAN I FIND A WEB DATABASE APPLICATION?
A: Intro Web Database Application A Web database is a database that can be administered and accessed v...
Q: atn -3 2w b) x(t) 3. 1 -6 -3 -2 3 4 6 . kje
A: Matlab code for Fourier Seriesclear allclose all%Question a.%function for which Fourier series have ...
Q: 3. An easier way to compute the gcd in python is to use the function gcd in the math library. Using ...
A: code : import math print(math.gcd(12345,333)) Code Snapshot : Output : Answer : 3
Q: Create a scenario to aid in the development of tests for the wilderness weather station system.
A: Wild weather conditions station This contextual analysis depends on the product for a wild weather c...
Q: Isn't it true that different operating systems keep disc folders in different track locations on the...
A: Introduction: The system's file and directory management. Internally, the system uses nodes to keep ...
Q: For an object to be writable to an ObjectOutputStream, the object should be an instance of a class t...
A: I have given answer in next step.
Q: Computer Science ef get_syllable_count(poem_line: POEM_LINE, words_to_phonemes: PRONUNCIATION_DICT) ...
A: Given lines are ef get_syllable_count(poem_line: POEM_LINE, words_to_phonemes: PRONUNCIATION_DICT) ...
Q: Suppose list.add("Red") is an expression for adding an element to the list ArrayList. Which is the m...
A: According to the question the array list is used for to add the list by using data type which type o...
Q: Write a C++ program to add, subtract, mulitply and divide two fractions and display the result fract...
A: Note: The program result is in the fractional form not in the reduced/simplified form. If required k...
Q: Assume having a narrow low-pass channel that spans from a Frequency of 0Hz to 5400HZ, and a digital ...
A: Here we calculate the minimum frequency required for analog by using the given information and fill ...
Q: In a memory block, what does address space imply?
A: Introduction: The memory block comprises the block of addresses requested by the process, as well as...
Q: What is software re-engineering?
A: To define software reengineering.
Take a look at the following class here in c++..
class myDocument {
public:
myDocument(const char *docname);
~myDocument();
void print();
create an object for the above class that will opens a .txt file and remains open.
utilize method print() to output the text in the .txt file to the screen.
The constructor will be used to close the file. Lastly, if the file cannot be read, an exception must be thrown by the constructor.
ensure that function main() must provide and handles exceptions correctly.
Step by step
Solved in 2 steps
- Complete the following program that reads a file (where the file name is provided tothe main method as parameter) that contains the students’ information, adds 2 to thetotal marks (without updating the file), and prints student information and whether ispassed or not. public class ProcessGrades { public static void main(String[] args) throws Exception { String fileName = args[0]; Scanner s = new Scanner(Paths.get(fileName)); while(s.hasNext()) { // add you code here } }}You must pass the name of the file as option while running the file. So you can run yourprogram using a command line similar to: java ProcessGrades results.txtIt is supposed to have the following output (after running the program):100 Fahd 95.00 Passed101 Omar 52.00 Failed102 Anas 60.00 PassedSave the following C++ program into a file classes.cpp: #include <iostream>using namespace std;class A {public:A() { x = 0;}void increment() { x++; }virtual void decrement() { x--; }void print() {cout << "x = " << x << endl;}protected:int x;};class B : public A {public:void increment() { x = x + 2; }virtual void decrement() { x = x - 2; }};int main() {A a; // a is an object of class AA * ptr; // ptr is a pointer to an object of class Aptr = &a;ptr -> increment();ptr -> print();ptr -> decrement();ptr -> print();} Compile the program classes.cpp, run it. Make sure that the program compiles and runs. Question 1. In the main function, add an object b of class B. Set the pointer ptr to point to b. Call increment() and decrement() on the object pointed to by ptr, print the object after each call. Which method gets called in each case? Why? Question 2. Add a protected variable int y to B and a constructor to initialize y to 0. Add a…can you please separate the classes of this program? and make it runnable like main driver class should be separated and where the function should be in another .c files which are given below void create_inventory(); void update_vacc_qty(); int search_vaccine(); void display_vaccine(); #include <stdio.h> #include <stdlib.h>#include <string.h> struct vacc{ char vaccName[15]; char vaccCode[2]; char country[15]; int qty; float population; }v[10]; // Function Declarations void create_inventory(); void update_vacc_qty(); int search_vaccine(); void display_vaccine(); // Main Function starts here int main() { int ch;do {printf("\n 1:create inventory");printf("\n 2: display vaccine info ");printf("\n 3: search vaccine");printf("\n enter your choice (0 to exit):");scanf("%d",&ch); switch (ch){case 1: create_inventory();break;case 2: display_vaccine();break;case 3: search_vaccine();break;default : break;} }while(ch!=0);return 0; } void create_inventory() { int…
- This is for Advanced Java Programming Write a test program that reads words from a text file and displays all non-duplicate words in ascending order and then in descending order. - The file is to be referenced in the program, not needing to be used as a command line reference. - The word file is to be titled collection_of_words.txt and included in your submission. Write test code that ensures the code functions correctly.How do I make this program in C++? I've posted this before, but I've only gotten wrong answers. Problem Write a C++ program that will simulate a Change Password Utility. Your program will contain: One class, PasswordManager, that will manage a single password for a given username. A driver containing a main function that will allow the user to change their password. PasswordManager Class The PasswordManager class should have two member variables (both strings): a username an encrypted password. Do not store the password (in the class or in a text file) unencrypted! The PasswordManager class should have the following two internal member functions (not accessible outside of the class): encrypt: this takes a password (a string) and returns the encrypted form of the password. Note: there is no decrypt function (there is no need to decrypt passwords). We will use the following VERY simple encryption algorithm (a Caesar Cipher): For every character in the input string, add 37 to the…Given the following definition of the classes Person, Father, and Home,which option, if used to replace/* INSERT CODE HERE */,will cause the code to compilesuccessfully (select 3 options):class Person {}class Father extends Person {public void dance() throws ClassCastException {}}class Home {public static void main(String args[]) {Person p = new Person();try {((Father)p).dance();}//INSERT CODE HERE}}Question options: catch (NullPointerException e) {}catch (ClassCastException e) {}catch (Exception e) {}catch (Throwable t) {} catch (ClassCastException e) {}catch (NullPointerException e) {}catch (Exception e) {}catch (Throwable t) {} catch (ClassCastException e) {}catch (Exception e) {}catch (NullPointerException e) {}catch (Throwable t) {} catch (Throwable t) {}catch (Exception e) {}catch (ClassCastException e) {}catch (NullPointerException e) {} finally {}
- I have the following code; a lot of details are unclear; this is a Java code; please draw the CFG (Control Flow Graph); it should look something like this: this is the source code: private void function() { try{ var1 = something; var2 = something; var2.function2(1,param1. param2);var2.function2(2, param1. param2); var3 = something; if (var3 > 0) { statements; } else { statements;} }//end of the try catch (exception) {print; } // end of catch }//end of the functioncan you please separate the classes of this program? and make it runnable like main driver class should be separated and where the function should be in another .c file void create_inventory(); void update_vacc_qty(); int search_vaccine(); void display_vaccine(); #include <stdio.h> #include <stdlib.h>#include <string.h> struct vacc{ char vaccName[15]; char vaccCode[2]; char country[15]; int qty; float population; }v[10]; // Function Declarations void create_inventory(); void update_vacc_qty(); int search_vaccine(); void display_vaccine(); // Main Function starts here int main() { int ch;do {printf("\n 1:create inventory");printf("\n 2: display vaccine info ");printf("\n 3: search vaccine");printf("\n enter your choice (0 to exit):");scanf("%d",&ch); switch (ch){case 1: create_inventory();break;case 2: display_vaccine();break;case 3: search_vaccine();break;default : break;} }while(ch!=0);return 0; } void create_inventory() { int option = 1; char…Write in C for STM32F446RE microcontroller on the Nucleo-64 dev board uncluding proper header files Write a source library that contains the with the following public functions: void keypadInit(void); /Initiallized the GPIO to read the keypad. uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called. void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed. The library should work with the following main: int main (void) { uint16_t key; char carray[17]; keypadInit(); while(1) { while(!(key = readKeypad())); /*Get which keys pressed*/ decodeKeypad(key, carray); /*What are those keys*/ printf("%s\n",carray); /*Print those keys to screen*/ while(readKeypad() == key); /*Wait for the keypad to change*/ }} Problem 1: Write a library that works with the following…
- Part 1: In C#, Create a Class Called FileRoot As we know, when we run a program, the program runs from the bin folder. If I had a file stored at the root of the project and if the program is running, it wouldn't know where it is unless it came out of the bin folder. Before implementing the classes below, create a class that will help you get from the bin folder to the project's root. Hint: Directory class and its static methods would help here.The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program. Hint: You shouldn't have to add or delete any lines of code for Debugging 9-2. This one can be done by just editing the lines that are there. // Creates a Breakfast class // and instantiates an object // Displays Breakfast special information using System; using static System.Console; using System.Globalization; class DebugNine2 { staticvoidMain() { Breakfast special = new Breakfast("French toast, 4.99); //Display the info about breakfast WriteLine(INFO); // then display today's special WriteLine("Today we are having {1} for {1}", special.name, special.Price.ToString("C2", CultureInfo.GetCultureInfo("en-US"))); } } class Breakfast { public string INFO = "Breakfast is the most important meal of the day."; // Breakfast constructor requires a // name, e.g "French toast", and a price public Breakfast(string name, double price) { name = name; price = price; } public string Name {get; set}…Must be written in Python. Please include docstring and show how output should look like. Remember that all data members should be private. An object can access it's own private data members directly. It can also access the private data members of other objects of the same class directly. But when accessing a private data member of an object of another class, it needs to call the appropriate get method. If that sounds complicated, just remember this: if a method is in the same class as a private data member, then it can access that data member directly, otherwise, it needs to use a get method. Write a class named Point that has two data members, x_coord and y_coord, representing the two coordinates of the point. It should have: an init method that takes two arguments, an x-coordinate and y-coordinate (in that order), and uses them to initialize the two data members. get methods for the two data members: get_x_coord and get_y_coord. a method named distance_to that takes a Point object…