Question

W8 problems, one of coding type, and one of decoding type Coding: construct a word using only letters of another word Dec

please answer the two questions using the direction on the top please

the direction is already at the top, we are using c#

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Problem 1 :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Build
{
class Program
{
static void Main(string[] args)
{
string actualString = "Together";
string buildString;
buildString = actualString.Substring(5);
Console.WriteLine("Builded string is "+buildString );
Console.ReadKey();
}
}
}

Problem 2:

Output :

Code has errors.
1.. The name 'str' does not exist in the current context   Build
2..   cannot convert from 'int' to 'string'   Build

After removing errors :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Build
{
class Program
{
static void Main(string[] args)
{
string str = "together";
string str2 = str.Substring(5, 1).ToUpper() + str.Substring(6, 1) + " ";
Console.WriteLine("First Output : "+str2);
str2 = str.Substring(2, 3);
str2 = str.Insert(4,"")+"";
str2 = str.Substring(5,3);
Console.WriteLine("Second Output : " + str2);
Console.ReadKey();
}
}
}

t e/c/users/usex/decuments visual studio 2015/Pojects/BuildBuild/bin/Debug /BuidExE First Output He Second Output her Activat

Add a comment
Know the answer?
Add Answer to:
please answer the two questions using the direction on the top please the direction is already...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT