Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:36:35+00:00 2026-06-09T16:36:35+00:00

So for this C# class I have to have the user input a 7

  • 0

So for this C# class I have to have the user input a 7 digit phone number into the console. Each number is stored as a different character. Then each character is changed to a letter. There is no logic behind the letters the numbers are changed to. (I really don’t see the point of this assignment, which might be contributing to my coder’s block.) Here’s what the assignment says.

Your mission: A prepaid phone service needs a program that converts alphanumeric keyboard input into a phone number. The user will input eight characters and the program will output either an error message or the translated seven-digit phone number. The input may contain digits, letters, or both. Letters can be uppercase or lowercase.

Method of Coding:

  • Main(): Declares seven character variables and passes these to the following methods by reference:
    • ProcessInput(): gets user input and performs the conversion
      • ShowResults(): displays the results
        • GetInput(): Gets seven characters from the user and stores them into the seven variables Main() has passed by reference.
        • ProcessInput(): Calls ToDigit() for each, passing each character variable by reference, and returns one of these codes to Main() by value:
          o 0 if there were no input errors
          o -1 if there were input errors”

The program will perform the conversion per a standard telephone keypad layout.

Basically, 2 s A,B,C
3 is D,E,F
Etc and then D, E, F is 3 and so on.

Right now I have nothing done except for an input, but it’s not stored as characters, just a string. I really hate this assignment because we just did two assignments with Cases and If statements, it just seems redundant to me.

Console.WriteLine("Write a Phone Number that consists of Seven Numbers.");
string Number = Console.ReadLine();

if (Number.Length != 7)
    Console.WriteLine("You have entered a phone number that is too long.");

Console.WriteLine("You have entered: {0}", Number);
Console.ReadLine();

So my real question is: How do I store the input number as a character and then define those characters with case statements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:36:36+00:00Added an answer on June 9, 2026 at 4:36 pm

    Really sorry for not responding to this or picking a right answer, I eventually figured it out on my own. The reason I was having so much trouble was because I thought I was suppose to create several outputs for 1(800)384-2347 and convert the last 4 numbers into various letters that might make sense. But it was just a simple case statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class User that looks like this: class User { private: char*
I have this Class: public class User { public string id{ get; set; }
I have a relationship like this class User include Mongoid::Document include Mongoid::Timestamps embeds_one :setting
I have a simple model like this: class User < ActiveRecord::Base serialize :preferences end
I have a files structure like this: Class (folder): - User.php - Rule.php Scripts
I have a model class like this: class Note(models.Model): author = models.ForeignKey(User, related_name='notes') content
I have a model that looks like this: class Invite(models.Model): user = models.ForeignKey(User) event
I have a two models set up like this: class User < ActiveRecord::Base #
I have a model.py like this: class EventTypeCategory(models.Model): name = models.CharField(max_length=50, verbose_name=Name) user =
We have some input elements on the page: <input type=text class=lovely-input name=number value= />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.