1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Murrr4er [49]
3 years ago
13

Assume the existence of a class named window with functions named close and freeresources, both of which accept no parameters an

d return no value . write a destructor for the class that invokes close followed by freeresources.
Computers and Technology
1 answer:
denis-greek [22]3 years ago
7 0
In your question whereas there is a class named window and it would be like this:

class window {
//code here 
}

Next is there is a function called close and freeresource and it goes like this:

class window{
  function close( ){
   //code here
  }
  function freeresource( ){
  // code here
  }
 public destruct (){
this.close();
this.freeresource();
}

}
The last code function destruct invokes the function close and freeresource. Hope this would help 

You might be interested in
Explain set associative mapping<br>​
gtnhenbr [62]
Set-associative mapping allows that each word that is present in the cache can have two or more words in the main memory for the same index address. Set associative cache mapping combines the best of direct and associative cache mapping techniques.
6 0
3 years ago
Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
worty [1.4K]

Answer:

The program to this question as follows:

Program:

//header file

#include <iostream> //defining header file

using namespace std;

void printFeetInchShort(int numFeet,int numInches); //decalring method printFeetInchShort  

void printFeetInchShort(int numFeet,int numInches)//defining method printFeetInchShort

{

cout<<"height: "; // print message

cout<<numFeet<<"\'"<<""<<numInches<<"\""; //print value

}

int main() //defining main method

{

int numFeet, numInches; //defining integer variable

cout<<"Enter height feet: "; //print message

cin>>numFeet; //input value by user

cout<<"Enter height inches: "; //print message

cin>>numInches; //input value by user

printFeetInchShort(numFeet,numInches); //calling method printFeetInchShort    

return 0;

}

Output:

Enter height feet: 5

Enter height inches: 9

height: 5'9"

Explanation:

In the above C++ language program, first, a header file is included, that uses the basic function, in the next step, the "printFeetInchShort()" method is defined, in the method two integer variables passed as a parameter, inside this method a print function "cout" is used, that print user input value with single and double quote.

Then the main method is declared, inside this method two integer variables "numFeet and numInches" are defined, which is used to take input value by user and pass the value in "printFeetInchShort()" function parameter and call the function.

4 0
3 years ago
Read 2 more answers
What is the term used for describing the judgement or common sense part of problem solving​
Triss [41]

Answer:

Explanation:

Heuristic

6 0
3 years ago
You want to securely erase data from your hard drive what can you use to do this and what is the process called
tankabanditka [31]
You could Factory Reset a computer or you could smash it with  a hammer
7 0
2 years ago
Read 2 more answers
The Speed of Sound (Java Project. Please make it easy to understand. I'm a beginner at this. I believe we are supposed to use a
Ilya [14]

Answer:

The program of this question can be given as:

Program:

//import pacakge for user input.

import java.util.Scanner;

//define class  

public class SpeedofSound              

{

  public static void main(String a[]) //define main function

  {  

      //define variable.

      String medium;                            

      double distance,time=0;

      //creating Scanner class object for input from user.

      Scanner s=new Scanner(System.in);  

      //print message.

      System.out.printf("Enter medium(air,water or steel) : ");

      medium=s.nextLine();  //taking input.

      //print message.

      System.out.printf("Enter the distance that the sound will travel : ");

      distance=s.nextDouble(); //taking input.

      switch(medium) //checking condtion between range.

      {

          case "air":

                  time=distance/1100;         //apply formula

                  break;

          case "water":

                  time=distance/4900;            //apply formula

                  break;

          case "steel":

                  time=distance/16400;            //apply formula

                  break;

          default:

                  System.out.printf("Sorry, you must enter air,water or steel"); //error for invalid input of medium

                  System.exit(0);

      }

      System.out.printf("It take "+time+" seconds"); //print final answer.

  }

}

Output:

Enter medium(air,water or steel) : air

Enter the distance that the sound will travel : 200

It take 0.18181818181818182 seconds

Explanation:

In this program first, we import packages for user input. Then we declare the class in the class we declare all the variables and then we create the scanner class object. It is used for taking input from the user. Then we use the switch statement It is used for condition. It works between the ranges. In the switch statement, we apply all the formula that is given in the question. and at the last, we print the output using printf function in java.

6 0
3 years ago
Other questions:
  • Why is it that even though there aren't the max number of answers on a question, (or sometimes even NO answers) When I click the
    11·1 answer
  • All of the following are qualities of an aprenticeship except
    12·1 answer
  • A forensic investigation discovered that accounts belonging to employees who were terminated numerous years ago were recently us
    9·1 answer
  • You want to make the background of a Web page blue, click _____.
    13·2 answers
  • How do you close a file?
    12·2 answers
  • A single-user/single-tasking operating system allows only one user to perform one task at a time. A real-time operating system g
    13·1 answer
  • Is this App for real?​
    5·1 answer
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • If 209g of ethanol are used up in a combustion process, calculator the volume of oxygen used for the combustion at stp​
    5·1 answer
  • How do i mark brainliest?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!