Let P(n) be "a postage of n cents can be formed using 5-cent and 17-cent stamps if n is greater than 63".Basis step: P(64) is true since 64 cents postage can be formed with one 5-cent and one 17-cent stamp.Inductive step: Assume that P(n) is true, that is, postage of n cents can be formed using 5-cent and 17-cent stamps. We will show how to form postage of n + 1 cents. By the inductive hypothesis postage of n cents can be formed using 5-cent and 17-cent stamps. If this included a 17-cent stamp, replace this 17-cent stamp with two 5-cent stamps to obtain n + 1 cents postage. Otherwise, only 5-cent stamps were used and n 65. Hence there are at least three 5-cent stamps forming n cents. Remove three of these 5-cent stamps and replace them with two 17-cent stamps to obtain n + 1 cents postage.Hence P(n + 1) is true.
Answer:
The constructor signature is defined as the constructor name followed by the parameter list.
Explanation:
In object oriented programming, a class constructor is a special method that will run automatically whenever a new object is created from the class. The constructor name is same with the class name. Besides, the class constructor is often used to initialize the attributes with initial values. Those initial values are held by the parameter list of the constructor.
One example of the constructor defined in a Java class is as follows:
// class name
public class BankAccount {
// attribute names
private String holder;
private double amount;
// constructor name
public BankAccount(String holder, double amount) // parameter list
{
this.holder = holder;
this.amount = amount
}
}
Answer:
The correct option is B
B. How many states have a higher percentage of female computer science majors than male computer science majors attending college in that state?
Explanation:
A.We can not analyze that students majoring in computer science tend to have higher grade point averages than students majoring in other subjects because we are only given data sets about computer science not about other majoring subject students
B. Because data set contains attributes of gender and state so we can easily analyze that how many states have a higher percentage of female computer science majors than male computer science majors attending college in that state.
C.We can not analyze that what percent of students attending college in a certain state are majoring in computer science because data sets doesn't contain any information about students other computer science students.
D. We can not analyze that which college has the highest number of students majoring in computer science because data sets doesn't contain attribute of college name.
Answer:
float diameter=2*r; //hold the diameter of a circle
float PI; // float variable named PI.
Explanation:
Here we have declared two variable i.e diameter and PI of type float. The variable diameter will hold the diameter of a circle i.e 2*r where r is the radius of a circle.
Following are the program in c++
#include <iostream> // header file
using namespace std; // namespace
int main() // main function
{
float r=9.2; // variable declaration
float diameter=2*r; //hold the diameter of a circle
float PI=3.14; // float variable named PI hold 3.14
cout<<"diameter IS :"<<diameter<<endl<<"PI IS :"<<PI; // display value
return 0;
}
Output:
diameter IS :18.4
PI IS :3.14