|
-
Nov 25th, 2001, 08:42 AM
#1
Thread Starter
New Member
Please can you take a look!!!!!!!!!!
Hi guys ,
Could any off you take a look at my assignment and gives some comments on any thing that does not look quite wright
Regard LEE.
Question 1: - Write the following program. Application of EXP to quality control. Explain the program commands and how the program works.
REM How many bulbs will remain?
DEF FNLeft (t, avgl) = 100 * EXP (-t / avgl)
CLS
Input “ Average lifetime (in hours) of a light bulb”;avgLIFE
PRINT, “Starting with 100 light bulbs, you can expect to have”
FOR I = avgLIFE / 2 TO 3 * avgLife STEP avgLife / 2
PRINT USING ### left after #### hours”; FNLeft (I, avgLife), I
NEXT I
END
The program shows an application of EXP for quality control
If a large quantity of light bulbs is a hours. Then the percentage of light bulbs still remaining after T hours is approximately EXP (-t/a). The Program shows how many light bulbs out of 100 you can expect to shine after various multiples of the average lifetime.
[run]
Press <shift + F5> Q Basic will then compile and execute the program. After the program has finished running, to return to the editor press any Key.
Average lifetime (in hours) of a light? 5000
Starting with 100 light bulbs, you can expect to have.
61 left after 2500 hours
37 left after 5000 hours
22 left after 7500 hours
14 left after 10000 hours
8 left after 12500 hours
5 left after 15000 hours
[run]
Average lifetime (in hours) of a light? 1000
Starting with 100 light bulbs, you can expect to have.
61 left after 500 hours
37 left after 1000 hours
22 left after 1500 hours
14 left after 2000 hours
8 left after 2500 hours
5 left after 3000 hours
[run]
Average lifetime (in hours) of a light? 200
Starting with 100 light bulbs, you can expect to have.
61 left after 100 hours
37 left after 200 hours
22 left after 300 hours
14 left after 400 hours
8 left after 500 hours
5 left after 600 hours
[run]
Average lifetime (in hours) of a light? 200
Starting with 100 light bulbs, you can expect to have.
61 left after 100 hours
37 left after 200 hours
22 left after 300 hours
14 left after 400 hours
8 left after 500 hours
5 left after 600 hours
[run]
Average lifetime (in hours) of a light? 100
Starting with 100 light bulbs, you can expect to have.
61 left after 50 hours
37 left after 100 hours
22 left after 150 hours
14 left after 200 hours
8 left after 250 hours
5 left after 300 hours
For 250 light bulbs
[run]
Average lifetime (in hours) of a light? 5000
Starting with 100 light bulbs, you can expect to have.
152 left after 2500 hours
92 left after 5000 hours
56 left after 7500 hours
34 left after 10000 hours
21 left after 12500 hours
12 left after 15000 hours
It's exponential decay in an old Q BASIC DOS mode program
Question 2: - Define and explain the following computer terms.RAM Random Access Memory. The working memory of the computer. RAM is the memory used for storing data temporarily while working on it, running application programs, etc. "Random access" refers to the fact that any area of RAM can be accessed directly and immediately, in contrast to other media such as a magnetic tape where the tape must be wound to the point where the data is. RAM is called volatile memory; information in RAM will disappear if the power is switched off before it is saved to disk. There is also a form of non-volatile RAM, which must be continually energized by a battery to maintain its content. The most common form of RAM is built from semiconductor integrated circuits.
Microprocessor
A computer with its entire CPU contained on one integrated circuit. The first microprocessor was created by Intel. The creation of microprocessors was the breakthrough that led to the development of personnel computers Microprocessors have, over time, acquired more and more of the features of large computers
Hardrive
Is a device that physically stores data in a computer, much like floppy disk, but the system is closed and the disks are hard (usually metal, although some glass versions have been developed). The closed system gives the possibility of more precision, so the drive is much faster and can hold much more data.
Speed of execution between Low and High Level Languages
Machine code and assembly languages are described as low-level languages in that they are orientated towards the computer hardware. High-level languages on the other hand are problem orientated and computer independent. High-level languages are written in an English or mathematical notation which is orientated towards solving practical problems. After the program source code has been entered into the computer it has to be converted into machine code (low level language) by a program called a compiler. Each statement in a high-level language can be converted into a number of machine code instructions. In general the compilation process is not 100% efficient so a program written in a high level language will take more memory and run more slowly than an equivalent assembly language. However, the advantages of working in a language which is orientated towards solving problems rather than the computer hardware means the majority of the application programs are written in high level languages.
Input devices
Peripheral devices that are used to enter commands or information into a computer, such as the keyboard, mouse, joystick, modem, scanner, and touch screen
Output devices
Peripheral devices through which information from the computer is communicated to the outside world; for example, the monitor, the printer, or speakers.
CPU
Central Processing Unit. The CPU controls the operation of a computer. Units within the CPU perform arithmetic and logical operations and decode and execute instructions. In microcomputers, the entire CPU is on a single chip.
ROM
Read-Only Memory. Memory that can be read but not changed. Read-only memory is non-volatile storage; it holds its contents even when the power is turned off. Data is placed in ROM only once, and stays there permanently. ROM chips are used for storage of the essential software of the computer, called firmware. Some kinds of ROM are; - Programmable Read Only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), Electronic Erasable programmable Read Only Memory (EEPROM), and Compact Disk Read Only Memory (CD-ROM).
Software
Software is the computer program that tells a computer's hardware what to do. System software is the operating system that controls the basic functioning capabilities of the computer, network software enables multiple computers to communicate with one another, and language software is used to develop programs.
Hardware
The hardware is the physical part of a computer system; For example, the computer itself, a monitor, printer, memory and a video card are all hardware.
-
Nov 25th, 2001, 10:05 AM
#2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|