Write your class code here  data_type1 = DataType(‘Integer’, 1234)  print(data_type1.name)  print(data_type1.value)  print('=====================')  data_type2 = DataType(‘String’, ‘Hello’) print(data_type2.name)  print(data_type2.value)  print('=====================')  data_type3 = DataType(‘Float’, 4.0)  print(data_type3.name)  print(data_type3.value)

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 10E: Write a program named DemoJobs for Harolds Home Services. The program should instantiate several Job...
icon
Related questions
Question

Write a class that for running the following codes: 

[You are not allowed to change the code below] 

#Write your class code here 

data_type1 = DataType(‘Integer’, 1234) 

print(data_type1.name) 

print(data_type1.value) 

print('=====================') 

data_type2 = DataType(‘String’, ‘Hello’) print(data_type2.name) 

print(data_type2.value) 

print('=====================') 

data_type3 = DataType(‘Float’, 4.0) 

print(data_type3.name) 

print(data_type3.value) 

Output: 

Integer 

1234 

===================== 

String 

Hello 

===================== 

Float 

4.0 

Subtasks: 

  1. Create a class named DataType with the required constructor.
  2.  Assign name and values in constructor according to the output.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage