derived3.f90

I suggest you either typed  this as it appears into the compiler, or as an easier way, just copy and paste it!

Note: I do not claim the program will 100% work, but I give it my best. If it doesn't, try tweaking it yourself, or email me about it, and I'll modify and post the improved version later. Good luck!

 

PROGRAM derived3
IMPLICIT NONE

TYPE Computer_Type
CHARACTER (LEN = 12) :: Brand_Name, Monitor_Type
CHARACTER (LEN = 12) :: CPU
CHARACTER (LEN = 4 ) :: Multimedia
END TYPE Computer_Type

TYPE Computer_Type2
INTEGER :: Clock_Speed
INTEGER :: RAM
INTEGER :: Cost
END TYPE Computer_Type2


TYPE (Computer_Type) :: Computer_1 
TYPE (Computer_Type2) :: Computer_2
INTEGER :: ans
PRINT*, "Please input the data for the first computer in the order detailed below:-"
PRINT*
GOTO 4
1 PRINT*, "Please input the data again as you have requested"
4 PRINT*, "The brand name (<12 characters), the monitor type (brand of <10 characters),"
PRINT*, "the CPU brand and the availability of multimedia capability (yes/no)"
PRINT*
READ*, Computer_1
PRINT*
PRINT*, "Thank you, now please input the following data:"
PRINT*, "The CPU's clock speed, the amount of RAM and the cost of the system"
READ*, Computer_2
PRINT*
PRINT*, "Brand Name Monitor CPU Multimedia"
PRINT*, "----------------------------------------------"
PRINT*, Computer_1
PRINT* 
PRINT*, "Clock Speed Amount System"
PRINT*, " of RAM Cost" 
PRINT*, "-----------------------------------" 
PRINT*, Computer_2
PRINT*
PRINT*, "Do you wish to enter another data string?"
PRINT*, "(1 for yes, 2 for no)"
READ*, ans
IF (ans==1)THEN
GOTO 1
ELSE IF (ans==2) THEN
GOTO 2
ELSE
GOTO 3
END IF
3 PRINT*, "Invalid selection. Try again."

2 PRINT*
PRINT*, "Thank you for using ADCY Computer Introductory Database Program"
PRINT*, "Have a nice day:)"

END PROGRAM derived3