User Defined Simple Data Type 168 250 Computer
- Slides: 16
User Defined Simple Data Type 168 250 Computer Programming For Engineer ��� ������ 6 ������� 2545
Top 10 ���������������� case Program Wrong. Data. Type; Var age: real; ���� ordinal data Begin ������ real ������ readln(age); Case age of 1. 0. . 12. 0 : writeln(‘You are children’); 13. 0. . 19. 0 : writeln(‘You are teenage’); Else writeln(‘You are adult’); Program Wrong. Data. Type; End; Var age: integer; End. Begin readln(age); Case age of ������� 1. . 12 : writeln(‘You are children’); 13. . 19 : writeln(‘You are teenage’); Ordinal data type Else writeln(‘You are adult’); End.
User Defined Data Type ����������� User defined data type �������� Pascal ������������������ �������� User defined data type ���� stan Data type ��� Pascal ������ Pascal �� 2 ������ user defined d type ������� scalar 1. Subrange data type 2. Enumerated data type
Top 10 �������������� Program My. New. Type; Type month = 1. . 12; day = 1. . 365; uppercase = ‘A’. . ‘Z’; Var lastmonth : month; today : day; ch : uppercase; Begin lastmonth : = 14; ch : = ‘h’; writeln(lastmonth, ch); End. ������� type ���� lastmonth ����� mo ������� 1� ������� ch ������������ keyboard ������ readln � ������������
Enumerated Data Type ���� data type ��������� �� ������������� Type ������� = (������� 1, ���� 2 ���� Program My. New. Type; Type days = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); color = (white, red, yellow, orange, green, purple, blue, black); Var today : days; mycarcolor : color; ������� Begin today : = Friday; mycarcolor : = white; �������� ��� color
���� enumerated data type ���� subrange data type ��� enumerated data type �� Ordinal data type ������ enumerated data type �� Pascal ������������� 1 ���������� Type days = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); ����� Ord(Sunday) ����� 0 Ord(Tuesday) ����� 2 Ord(Saturday) ����� 6 ������������ function ord( ) ������� Enumerated data type ���
����� Enumerated Data Type Program My. New. Type; Type days = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); color = (white, red, yellow, orange, green, purple, blue, black); Var today, d: days; mycarcolor : color; Begin today : = Friday; mycarcolor : = white; ��� assign ������ data ������� for d : = Sunday to Saturday Do writeln(ord(d)); ������ for ���� ord( ) ����� if mycarcolor < > red then writeln(‘My car color is not red’); ������
����� Enumerated Data Type (��� ) ��� Assign ������������ ���� today : = Friday; Mycarcolor : = white; ������������ ��� �� today : = ‘Friday’; Mycarcolor : = ‘white’; ������� for For today : = Monday to Friday Do writeln(‘working day!’);
����� Enumerated Data Type (��� ) ������������ case ��� Case today of Monday. . Friday : writeln(‘Let’s go to school!’); Sunday, Saturday : writeln(‘have a nice holiday’); End; ����� logical expression monday > tuesday ����� false Pred(Friday) = Thursday ����� true Succ(Friday) = Saturday ����� true Tuesday <= Wednesday ����� true Succ(Monday) < > pred(Wednesday) ����� false Pred(pred(Saturday))) = Wednesday ����� true
����� Enumerated Data Type (��� ) ������� index ������ Array Program My. New. Type; Type days = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); color = (white, red, yellow, orange, green, purple, blue, black); Var b : array [ days ] of integer; x : array [white. . Green] of real; today : days; Begin for today : = Sunday to Saturday Do begin write(‘Please enter number of students today : ’); readln(b[today]); end; ……. .
������� Enumerated data type ������������ Type ����������� enumerated data type Case n of 1. . 5 : writeln(‘Let’s go to school!’); 0, 6 : writeln(‘have a nice holiday’); End; ����� 0 ��� 6 ������ ���������� enumerated data type ����� Case today of Monday. . Friday : writeln(‘Let’s go to school!’); Sunday, Saturday : writeln(‘have a nice holiday’); End; ���������
- Macam tipe data
- What is a collection of well-defined objects
- Sql user defined table
- User defined function matlab
- User defined function in qbasic
- User defined function fluent
- User defined functions in java
- User-defined functions
- Single user and multiple user operating system
- Rtos multitasking
- Abcd orm process
- Computer
- Type of user support
- Computer user logo
- Flatbed sheet fed pen and handheld are types of
- A computer that serves one user at a time
- What is the multimedia software