Skip to content
Snippets Groups Projects
Commit c6e898b5 authored by dali662d's avatar dali662d
Browse files

Upload New File

parent 799d2bcb
No related branches found
No related tags found
No related merge requests found
module wichtel_mod
use zeit_mod
implicit none
private
public :: wichtel, GET, PUT, change_zeit
type wichtel
private
character (len=20) :: name
type(zeit) :: zeit_worked ! stunden an arbeit
end type
interface GET
module procedure einlesen_wichtel
end interface
interface PUT
module procedure ausgeben_wichtel
end interface
interface change_zeit
module procedure change_zeit_worked
end interface
contains
subroutine einlesen_wichtel(elf)
type(wichtel), intent(out) :: elf
write(*,*) "Wie heisst der Wichtel?"
read(*,*) elf%name
write(*,*) "Wie viele Stunden, Minuten und Sekunden hat ", trim(elf%name), " gearbeitet?"
call get(elf%zeit_worked)
end subroutine einlesen_wichtel
subroutine ausgeben_wichtel(elf)
type(wichtel), intent(in) :: elf
write(*,*) "Der Wichtel ", trim(elf%name), " hat insgesamt ", zeit_string(elf%zeit_worked), " Stunden gearbeitet."
end subroutine
subroutine change_zeit_worked (elf, time)
type(wichtel), intent(inout) :: elf
type(zeit), intent(in) :: time
elf%zeit_worked = time
end subroutine
end module wichtel_mod
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment