USING C#
1. Write a program that takes outputs a string, an integer and a floating-point number separated by commas. Sample output: Bob Marley, 20, 5.2 2.
2. Write a program that asks the user for a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’). Generate a random number of any size, integer or floating point, and combine those three pieces of information (in any order) to create a password and display that out to the user. Sample input 1: ILikePatterns + Sample output 1: 525235325ILikePatterns+ Sample input 2: ILikeDecimalNumbers / Sample output 2: ILikeDecimalNumbers/52325.25
1.
using System;
class MainClass {
public static void Main (string[] args) {
//Console.WriteLine ("Hello World");
String str;
int number;
float floatNumber;
Console.WriteLine("Enter a strting: ");
str=Console.ReadLine();
Console.WriteLine("Enter a number: ");
number=(int)Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter a float number: ");
floatNumber=(float)Convert.ToDouble(Console.ReadLine());
Console.WriteLine(""+str+","+number+","+floatNumber);
}
}
==============
//Output
Enter a strting:
Bob Marley
Enter a number:
20
Enter a float number:
5.2
Bob Marley,20,5.2
=========================
2.
using System;
class MainClass {
public static void Main (string[] args) {
Console.WriteLine (" Enter a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’): ");
string str="";
char c;
while(true)
{
c=(char) Console.Read();
if(c == 32) //if space don't take it
continue;
if(c>=33 && c<=47)
{
str+=c;
break;
}
str+=c;
}
Console.WriteLine ("\nString enetered is: "+str);
}
}
==========================
Enter a string of letters of any size (no spaces), and finally a
special character (values 33 to 47 in the Ascii table, or ‘!’ to
‘/’):
Hello WORLD!
String enetered is: HelloWORLD!
========================================
3.
using System;
public class Program {
public static void Main() {
Random rand = new Random();
int size= rand.Next(1,10);
Console.WriteLine("Enter a string: ");
string str=Console.ReadLine();
string str1="";
//generate integer number
for(int i = 0; i < size; i++)
str1+=rand.Next(0,10)+48;
string result=str+str1+"+";
Console.WriteLine(""+result);
}
}
=========================
//Output
Enter a string:
ILikeDecimalNumbers
ILikeDecimalNumbers48575149+
USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number s...
4.18 LAB: Checker for integer string Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Exx If the input is: 1995 the output is: yes Ex If the input is: 42,000 1995! the output is no Hint: Use a loop and the Character isDigitO function. 418.1: LAB: Checker for integer string
#In Coral CHALLENGE ACTIVITY 7.1.1: Convert to binary. Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than e Output x % 2 (remainder is either e or 1) x= x / 2 Note: The above algorithm outputs the O's and 1's in reverse order. Ex: If the input is 6, the output is: 011 (6 in binary is 110; the...
Write a program that takes in a line of text as input, and outputs that line of text in reverse. You may assume that each line of text will not exceed 50 characters. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Ex: If the input is: Hello there Hey quit then the output is: ereht olleH уен Hint: Use the fgets function to read a string with spaces from the user...
Using Java write a program that takes a string input from the user and then outputs the first character, then the first two, then the first three, etc until it prints the entire word.
Write a C++ program to get an input string from the user, and output the string in uppercase letters. Use a dynamic character array to store the string. ?(this can be from any input file, there is no specific file.)
Write the Code in C program. Create a random password generator that contains a user-specified number of characters. Your program should prompt the user for the desired length of the password. Length of password: To create your password, use the random number generator in the stdlib.h C library. To generate random numbers, you will need the srand() and rand() functions. srand(seed) is used to "seed" the random number generator with the given integer, seed. Prompt the user for the seed...
Write a program that takes an operation (+, -, /, or *) and two floating-point numbers, and outputs the result of applying that operation to the two numbers. For example, if the input is: + 100 3.14 the output should be 100 + 3.14 = 103.14 Likewise, if the input is * 4 5 the output should be 4 * 5 = 20 You may assume the input is well-formed; that is, the first string is one of the four...
Python question: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x modulo 2 (remainder is either 0 or 1) Assign x with x divided by 2
In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...
Write a basic ARM program that takes a string as input, then outputs a string that replaces all the vowels in the input string with 'x'. Vowels: a, A, e, E, i, I, o, O, u, U. **I am using DS-5 Eclipse Community Workspace with ARM assembly language.** The program should give the following input prompt: "Input a string: " Then, the program should output the string with the vowel(s) replaced with x. The program should terminate upon printing the...