将下面的伪码转换为程序流程图和PAD图 do while q=0 ...... if r=0 then goto C end do w=0 x=0 C: y=0 Z=0
时间: 2024-06-08 19:06:27 浏览: 126
程序流程图:
```
+--------------+
| Start Do-While Loop |
+--------------+
|
v
+-------------+
| q = 0 |
+-------------+
|
v
+----------------------+
| Check if r is equal to 0 |
+----------------------+
|
v
+----------------------+
| Jump to C if r=0 |
+----------------------+
|
v
+-----------------------+
| Set w to 0 |
+-----------------------+
|
v
+-----------------------+
| Set x to 0 |
+-----------------------+
|
v
+-----------------------+
| Label C |
+-----------------------+
|
v
+-----------------------+
| Set y to 0 |
+-----------------------+
|
v
+-----------------------+
| Set z to 0 |
+-----------------------+
|
v
+----------------------+
| End Do-While Loop |
+----------------------+
```
PAD图:
```
┌─────────────┐
│ Start Do-While Loop │
└─────────────┘
│ q = 0
v
┌─────────────┐
│ Check if r is equal to 0 │
└─────────────┘
│
v
┌───────────────────────┐
│ Jump to C if r = 0 │
└───────────────────────┘
│
v
┌───────────────────────┐
│ Set w to 0 │
└───────────────────────┘
│
v
┌───────────────────────┐
│ Set x to 0 │
└───────────────────────┘
│
v
┌─────────────┐
│ Label C │
└─────────────┘
│
v
┌───────────────────────┐
│ Set y to 0 │
└───────────────────────┘
│
v
┌───────────────────────┐
│ Set z to 0 │
└───────────────────────┘
│
v
┌─────────────┐
│ End Do-While Loop │
└─────────────┘
```
阅读全文