Answer:
Explanation:
class Pet:
def __init__(self):
self.name = ''
self.age = 0
def print_info(self):
print('Pet Information:')
print(' Name:', self.name)
print(' Age:', self.age)
class Dog(Pet):
def __init__(self):
Pet.__init__(self)
self.breed = ''
def main():
my_pet = Pet()
my_dog = Dog()
pet_name = input()
pet_age = int(input())
dog_name = input()
dog_age = int(input())
dog_breed = input()
my_pet.name = pet_name
my_pet.age = pet_age
my_pet.print_info()
my_dog.name = dog_name
my_dog.age = dog_age
my_dog.breed = dog_breed
my_dog.print_info()
print(' Breed:', my_dog.breed)
main()
Answer:
//Program was implemented using C++ Programming Language
// Comments are used for explanatory purpose
#include<iostream>
using namespace std;
unsigned int second_a(unsigned int n)
{
int r,sum=0,temp;
int first;
for(int i= 1; I<=n; i++)
{
first = n;
//Check if first digit is 3
// Remove last digit from number till only one digit is left
while(first >= 10)
{
first = first / 10;
}
if(first == 3) // if first digit is 3
{
//Check if n is palindrome
temp=n; // save the value of n in a temporary Variable
while(n>0)
{
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
cout<<n<<" is a palindrome";
else
cout<<n<<" is not a palindrome";
}
}
}
Explanation:
The above code segments is a functional program that checks if a number that starts with digit 3 is Palindromic or not.
The program was coded using C++ programming language.
The main method of the program is omitted.
Comments were used for explanatory purpose.
Explanation:
The end-use industries of thermochromic materials include packaging, printing & coating, medical, textile, industrial, and others. Printing & coating is the fastest-growing end-use industry of thermochromic materials owing to a significant increase in the demand for thermal paper for POS systems. The use of thermochromic materials is gaining momentum for interactive packaging that encourages consumers to take a product off the shelf and use it.