Answer:
Class is the correct answer for the above question.
Explanation:
In an object-oriented language, The class is a structure type template, which is used to define the structure but the class does not take memory when an object is created then it takes the memory of class type. For example, if a user-defined class of one member whose size is 4 bit if its store in memory. When a user creates an object, then the object size is 4 bit.
That's why the class is an only structure while an object is used to give the memory for class member and the member of the class also get executed by the object of that class. class have no existence if object is not created. so when a user wants to create a object, he needs to create the object by the help of class name because class is user defined data type and object is variable of that class.
Then the answer of the above question is that object is created with the help of class which is described above.
Answer:
The program code is completed below
Explanation:
Program Code:
"""
Your Name
Course Name, Section (example: ENTD200 B002 Spr15)
Instructor name
Week #
Date completed
"""
months = ["January ", "February", "March", "April", "May", "June", "July"
, "August", "September", "October", "November", "December"]
for i in range(0,12):
print("Month",i+1, "is" , months[i])
Answer:
In Java:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String isbn;
System.out.print("First 1:2 digits: ");
isbn = input.nextLine();
if(isbn.length()==12){
int chksum = 0;
for(int i = 0; i<12;i++){
if((i+1)%2==0){ chksum+= 3 * Character.getNumericValue(isbn.charAt(i)); }
else{ chksum+=Character.getNumericValue(isbn.charAt(i)); } }
chksum%=10;
chksum=10-chksum;
if(chksum==10){
System.out.print("The ISBN-13 number is "+isbn+"0");}
else{
System.out.print("The ISBN-13 number is "+isbn+""+chksum); } }
else{
System.out.print("Invalid Input");
} }}
Explanation:
See attachment for explanation where comments are used to explain each line
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