{"id":64516,"date":"2021-10-23T22:52:11","date_gmt":"2021-10-23T22:52:11","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/10\/23\/c-exercises\/"},"modified":"2021-10-23T22:52:11","modified_gmt":"2021-10-23T22:52:11","slug":"c-exercises","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/10\/23\/c-exercises\/","title":{"rendered":"C# Exercises"},"content":{"rendered":"<p>1. Write a program that displays the name and address of your college. <br \/>You must match the format exactly: <br \/>Centennial College <br \/>Address: 941 Progress Ave, Scarborough, ON M1G 3T8 <br \/>2. Write a program that prompts the user for his name and average monthly <br \/>visa bill. The program displays his name and his annual visa bill. <br \/>You must match the format exactly <br \/>Name: Justin Bieber <br \/>Annual Visa Bill: $12,000.00 <br \/>Hint: annual bill = monthly bill * 12 <br \/>3. Write a program that prompts the user for a letter. The program prints <br \/>the letter and the number equivalent. The number equivalent is obtained <br \/>by casting the char to an int. <br \/>YOU MUST READ IN THE INPUT AS A CHAR and you MUST do an explicit cast <br \/>You must match the format exactly: <br \/>Char: a <br \/>Number Equivalent: 97 <br \/>4. Write a program that prompts the user for her home planet. Based on the <br \/>user&#8217;s input the program will display the following: <br \/>Input: earth <br \/>Message: earth. You are an Earthling and you have 10 fingers <br \/>Input: VENUS <br \/>Message: VENUS. You are a Venusian and you have 12 fingers <br \/>Input: Mars <br \/>Message: Mars. You are a Martian and you have 8 fingers <br \/>any other input <br \/>Message: I am sorry I don&#8217;t know of that planet <br \/>You may use either the ToUpper() or ToLower() methods <br \/>You MUST USE ONLY A SWITCH statement to solve this problem <br \/>[For full marks you need to accept all permutations of earth, venus <br \/>and mars, for example: &#8220;Earth&#8221;, &#8220;eARTh&#8221;, &#8220;VenuS&#8221;, &#8220;MARS&#8221;, &#8220;Mars&#8221;] <br \/>5. Write a program that prompts the user for her home planet. Based on the <br \/>user&#8217;s input the program will display the following: <br \/>Input: earth <br \/>Message: earth. You are an Earthling and you have 10 fingers <br \/>Input: VENUS <br \/>Message: VENUS. You are a Venusian and you have 12 fingers <br \/>Input: Mars <br \/>Message: Mars. You are a Martian and you have 8 fingers <br \/>Any other input <br \/>Message: I am sorry I don&#8217;t know of that planet <br \/>You may use either the ToUpper() or ToLower() methods <br \/>You MUST USE A NESTED IF statement to solve this problem [For full marks you need to accept all permutations of earth, venus and mars, for example: &#8220;Earth&#8221;, &#8220;eARTh&#8221;, &#8220;VenuS&#8221;, &#8220;MARS&#8221;, &#8220;Mars&#8221;] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Write a program that displays the name and address of your college. You must match the format exactly: Centennial College Address: 941 Progress Ave, Scarborough, ON M1G 3T8 2. Write a program that prompts the user for his name and average monthly visa bill. The program displays his name and his annual visa bill. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-64516","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/64516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=64516"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/64516\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=64516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=64516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=64516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}