ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
3 marks · Pre-defined functions
A company wants to extract the domain name from e‑mail addresses. The domain name is the part after the ‘@’ in the e‑mail address. For example, ‘qas.co.uk’ would be extracted from ‘robertsmith@qas.co.uk’. Using a design technique of your choice, design an algorithm to extract the domain name from any e‑mail address stored in the variable email and assign it to the variable domainName.
• loop for each character • identifying position of @ character • set domainName to all characters after the "@" sign Accept use of predefined functions for bullets 1 and 2.