VB icon

Mass and Time Converter in C#

Email
Submitted on: 1/21/2019 2:16:35 AM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: C#
Views: 974
author picture
 
     A very simple menu driven program written in C# to convert mass and time. I am currently accepting programming work, it projects, school and application development. programming projects, thesis and capstone projects, IT consulting. work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you. My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675. Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Mass and Time Converter in C#
// Description:A very simple menu driven program written in C# to convert mass and time.
I am currently accepting programming work, it projects, school and application development.
programming projects, thesis and capstone projects, IT consulting.
work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com
// By: Jake R. Pomperada
//**************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mass_Time_Converter
{
class Program
{
static void Main(string[] args)
{
bool repeat = true;
int num;
int num1;
int con;
while (repeat)
{
Console.WriteLine("\n");
Console.WriteLine("\t===== MAIN MENU =====");
Console.WriteLine("\n");
Console.WriteLine("\tSelect one to convert")
Console.WriteLine("\n");
Console.WriteLine("\t[1] Mass Conversion");
Console.WriteLine("\t[2] Time Conversion");
Console.WriteLine("\n");
Console.Write("\tYou choose: ");
con = Convert.ToInt32(Console.ReadLine());
if (con == 1)
{
Console.WriteLine("\tConvert Mass");
Console.WriteLine("\t1. Kilograms to Grams");
Console.WriteLine("\t2. Grams to Miligrams");
Console.WriteLine("\t3. Milligrams to Micrograms");
Console.WriteLine("\n");
Console.Write("\tYou choose what to convert: ");
num = Convert.ToInt32(Console.ReadLine());
if (num == 1)
{
Console.Write("\tEnter Number: ");
num1 = Convert.ToInt32(Console.ReadLine());
int ans = num1 * 1000;
Console.WriteLine(+num1 + " kilogram/s is equivalent to " + ans + " gram/s.");
Console.WriteLine("\tDo you want to convert again?");
Console.WriteLine("\n");
Console.WriteLine("\tContinue Yes or No?");
string ask = Console.ReadLine();
if (ask.ToLower() != "yes")
{
repeat = false;
Console.WriteLine("\tThank you for using this software.");
}
}
else if (num == 2)
{
Console.Write("\tEnter Number: ");
num1 = Convert.ToInt32(Console.ReadLine());
int ans1 = num1 * 1000;
Console.WriteLine(+num1 + " gram/s is equivalent to " + ans1 + " milligram/s.");
Console.WriteLine("\tDo you want to convert again?");
Console.WriteLine("\n");
Console.WriteLine("\tContinue Yes or No?");
string ask = Console.ReadLine();
if (ask.ToLower() != "yes")
{
repeat = false;
Console.WriteLine("Thank you!");
}
}
else if (num == 3)
{
Console.Write("\tEnter Number: ");
num1 = Convert.ToInt32(Console.ReadLine());
int ans2 = num1 * 1000;
Console.WriteLine(+num1 + " milligram/s is equivalent to " + ans2 + " microgram/s.");
Console.WriteLine("\tDo you want to convert again?");
Console.WriteLine("\n");
Console.WriteLine("\tContinue Yes or No?");
string ask = Console.ReadLine();
if (ask.ToLower() != "yes")
{
repeat = false;
Console.WriteLine("\tThank you for using this Software");
}
}
else
{
Console.WriteLine("\tError! Operation Not Found!");
Console.WriteLine("\tDo you want to convert again?");
Console.WriteLine("\tContinue Yes or No?");
string ask = Console.ReadLine();
if (ask.ToLower() != "yes")
{
repeat = false;
Console.WriteLine("\tThank you!");
}
}
}
else if (con == 2)
{
Console.WriteLine("Choose what to convert");
Console.WriteLine("1. Minutes to Seconds");
Console.WriteLine("2. Hours to Minutes");
Console.WriteLine("3. Days to Hours");
Console.Write("You choose what to convert: ");
num = Convert.ToInt32(Console.ReadLine());
if (num == 1)
{
Console.Write("Enter Number: ");
num1 = Convert.ToInt32(Console.ReadLine());
int ans3 = num1 * 60;
Console.WriteLine(+num1 + " minute/s is equivalent to " + ans3 + " second/s.");
Console.WriteLine("Do you want to convert again?");
Console.WriteLine("Yes or No?");
string ask = Console.ReadLine();
if (ask.ToLower() != "yes")
{
repeat = false;
}
else
{
Console.WriteLine("Thank you!");
Console.ReadKey();
}
}
}
}
}
}
}


Other 44 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.