// Sample Solution
using System;
namespace Review
{
class Program
{
static void Main(string[] args)
{
string someString = $"use the space to write your own short program! Here is what you learned: DATA TYPES: char, string STRING INTERPOLATION: blah blah STRING INFO: .Length, .IndexOf() PARTS OF STRINGS: bracketNotation[], .Substring() STRING MANIPULATION: .ToUpper(), .ToLower() Good luck!";
int someStringLength = someString.Length;
Console.WriteLine(someStringLength);
char[] someCharArray = someString.ToCharArray();
//randomize the case of letters in the string
for(int i=0; i<someStringLength; i++){
Random rnd = new Random();
int Up = rnd.Next(1,100);
if(Up>=50){
Console.Write(someCharArray[i].ToString().ToUpper());
} else {
Console.Write(someCharArray[i].ToString().ToLower());
}
}
}
}
}
No comments:
Post a Comment