Answer:
public class SimpleSquare{
public int num;
private int square;
public SimpleSquare(int number){
num = number;
square = number * number;
}
public int getSquare(){
return square;
}
}
Explanation:
*The code is in Java.
Create a class called SimpleSquare
Declare two fields, num and square
Create a constructor that takes an integer number as a parameter, sets the num and sets the square as number * number.
Since the square is a private field, I also added the getSquare() method which returns the value of the square.
C.) New discoveries make the current model inaccurate. Since
science is all about observation and experimentation, it is logical that
whenever new findings are gathered, scientific models must be modified to adapt
to the information. As new ideas and concepts are uncovered, models should be
updated to make them correct.
Answer:
Following are the statement in C++ language :
#include <iomanip> // header file
using namespace std; // namespace
int main() // main method
{
int x1,x2,x3,x4,x5; // variable declaration
cout<<" Enter the 5 sucessive integer:";
cin>>x1>>x2>>x3>>x4>> x5; // taking 5 input from user
cout<<right;
// prints each of its own line and form a right-justified
cout<<setw(5)<< x1 << "\n" << setw(5) << x2 << "\n" <<setw(5) << x3 << "\n" << setw(5) << x4 << "\n" << setw(5) << x5 << "\n";
return(0);
}
Output:
Enter the 5 sucessive integer: 45
23
445
6
8
45
23
445
6
8
Explanation:
Description of program is given below
- Declared a 5 integer value x1,x2,x3,x4,x5 respectively.
- Read the 5 integer value from user by using cin funtion.
- Finally Print these 5 value in its own line and form a right-justified by using setw() function on it
// Making a function that will take a integer as argument and return print the code
void Print(int statuscode){
// starting the switch statement on the interger sent
switch(statuscode)
case 200: // for case 200
cout << "Ok,Fullfilled"<< endl;
case 403: // for case 403
cout << "Forbidden" << endl;
case 404: // for case 404
cout << "Not Found" <<endl;
case 500: // for case 500
cout << "Server Error "<< endl;
default: // default case
cout << " Wrong code"<<endl;
}
Answer:
Computer science are the disciplines that study information, computing and the applications or ecosystems where they are developed. It is a science that comes from applied mathematics and has 3 branches that are quite well known. On the one hand we have software engineering, secondly theory as such (primary study of algorithms and data, etc.) and finally the application of the amalgam of the first two, which end up resulting in disciplines such as big data, cybersecurity or computer security, machine learning, artificial intelligence, etc. However, we are talking about a very broad science with various branches of work. Technological advances that have improved the scope of education, now allow us to develop in specific skills and computer science is one of the macro careers that have benefited the most thanks to the diversity of subjects it encompasses. This is where the on-demand courses available on the edX platform come in. Computer scientists are in one of the best times for their career advancement. We invite you to be part of the technological development and information and computing technologies through online courses.
Explanation: