The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Yesterday, the CS Club hosted a massive party that put all the frat parties to shame. Today, they have to clean up everything. They also have to restock the strategic supply of Mountain Dew. Phillip hates cleaning and wants to pick up the dew instead. He knows that they intend to distribute the chores by having everyone get a number between 1 and the number of people who actually stayed to help clean up. Once everyone has a number, they will start with the person who has number "1" and skip some number of people. The person who they land on will be given a specific cleaning task. The last person picked will not have to clean and will instead get the Dew. Help Phillip avoid work by creating a program that will take in the number of people participating and the number skipped and output which number Phillip should get in order to the last to get a chore.
Â
Â
Â
The number of people playing and the number being skipped.
Â
Â
The number that will be picked last.
Â
Tips:
Â
Â
Input: 41 3 Output: 31
q2
Emily is in love with ASCII art. She has become fascinated with creating pictures using nothing but the asterisk symbol (*). Her favorite picture to make is an hourglass, with the top part full and the bottom part empty. Surprise Emily with a program that will ask for how big an hourglass should be and will create an hourglass of that size using nothing but asterisks and dashes.
Â
Â
Â
The number of rows.
Â
Â
The ascii art hourglass.
Â
Input: 6 Output: ************ -**********- --********-- ---******--- ----****---- -----**----- -----**----- ----*--*---- ---*----*--- --*------*-- -*--------*- ************
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll