BreathingActivity

cs

School

Brigham Young University, Idaho *

*We aren’t endorsed by this school

Course

210

Subject

Computer Science

Date

Nov 24, 2024

Type

cs

Pages

1

Uploaded by ChancellorFreedomTapir22

Report
using System; using System.Collections.Generic; using System.Diagnostics; public class BreathingActivity : Activity { public BreathingActivity() { } //Constructor, showing inheritance of class members from the base class public BreathingActivity(string activityName, string activityDescription, int intendedDuration, string endingText) : base(activityName, activityDescription, endingText, intendedDuration) { } //Method to initiate and terminate the breathe exercise public string StartBreathingActivity(int intendedDuration) { DateTime currentTime = DateTime.Now; DateTime futureTime = currentTime.AddSeconds(intendedDuration); pauseActivity(); Console.WriteLine("Hit enter "); int countB = 0; while (DateTime.Now < futureTime) { DisplayAnimation(); Console.WriteLine("Breathe in.."); Console.WriteLine(); DisplayAnimation(); Console.WriteLine("Now breathe out.." ); Console.WriteLine(); countB = countB + 2; } Console.WriteLine(ConclusionMsg()); Console.Write($"You completed this Breathing exercise {countB} times in {intendedDuration} seconds. "); return Console.ReadLine(); } }
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help