Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Solution
- implicit none
- contains
- pure function numMags(weapon, numberOfStreets)
- character(*), intent(in) :: weapon
- integer, intent(in) :: numberOfStreets
- integer :: numMags, bullets_in_mag
- numMags = 0 ! TODO
- select case (weapon)
- case ('PT92')
- bullets_in_mag = 17
- case ('M4A1')
- bullets_in_mag = 30
- case ('M16A2')
- bullets_in_mag = 30
- case ('PT92')
- bullets_in_mag = 5
- end select
- do while (bullets_in_mag*numMags<numberOfStreets*3)
- numMags = numMags + 1
- end do
- end function numMags
- end module Solution
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement