救命!家庭作业!截止日期以C#结束。 [英] Help! Homework! Deadline closing in C#.

查看:65
本文介绍了救命!家庭作业!截止日期以C#结束。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我知道这很尴尬,但在学校任务中​​需要帮助,截止日期为3小时。刚刚开始。

救救我?谢谢。我知道我应该从这些中吸取教训,但由于一个确定性的错误,我正处于我的技能水平之外。我可能不会继续使用ICT,因为这太多了,但你真的可以让我免于尴尬。

I know this is embarrassing but need assistance in school tasks and the deadline is in 3 hours. Just started so.
Help me out? THANKS. I know I'm supposed to learn from these but due a bureatrical error I'm in a course out of my skill level. Am prob not going to continue ICT cause this is just too much, but you really could save me from an embarrassment.

#1制作一个程序,询问用户及其母亲的年龄并打印出两者减去的结果(母亲的年龄 - 你的年龄)

#1 Make a program which asks the age of the user and their mother and prints out the result of the subtract of the two ( mother's age - your age )

#2制作一个程序,询问正方形的两侧。在此之后,程序计算正方形的表面积。

#2 Make a program which asks the sides of a square. After this the program counts the surface area of the square.

#3制作一个程序,询问一个圆的光束,然后计算圆的表面积。

#3 Make a program which asks the beam of a circle and then counts the surface area of the circle.

#4制作一个要求过多卡路里的程序。程序打印出你消耗了多少焦耳。 "2000太多卡路里,8363焦耳"

#4 Make a program which asks too much calories. Program prints out how many joules did you consume. "2000 too much calories, 8363 in Joules"

#5制作程序保镖,如果是,则要求你高于18然后它说"欢迎"如果没有,那么"回家,长大"。 如果您的年龄介于18到20之间,程序会要求提供ID,如果没有,那么它会说"Nice
Try""

#5 Make program bouncer which asks are you above 18 if yes then it says "welcome" if no then "go back home, and grow up".  Make it also so that if your age is between 18 and 20 the program asks for IDs, if no then it says "Nice Try"

#6制作一个程序告诉是用户给出的数字不均匀甚至

#6 Make a program that tells is the number the user gives uneven or even

#7制作一个程序,询问你得分低于45或如果你把它高于55你可以拍拍自己的背面

#7 Make a program that asks did you score below 45 or if you made it above 55 you can pat yourself on the back

#8制作一个程序,询问你的0 - 5年级并使用开关案例 

#8 Make a program that asks for your grade 0 - 5 and uses switch-case 

0 - 失败

1 - 满意

2 - 满意

3 - 好郎
4 - 好郎
$ 5 - 优秀

0 - fail
1 - satisfying
2 - satisfying
3 - good
4 - good
5 - excellent

#9制作一个打印出数字的程序,可以用1到1000之间的数字3进行分割。使用while循环。

#9 Make a program that prints out numbers that can be divided with number 3 between 1 - 1000. Use while loop.

#10制作一个程序用户猜测1到100之间的数字,如果它太大,程序打印出"太大"的数字。如果它太小,那么"太小"当它正确时,它会打印出来"你明白了!"使用while循环。

#10 Make a program that makes the user guess a number between 1 - 100 and if it's too big the program prints out "too big" if it's too small then "too small" and when it's right it prints out " you got it!". Use while-loop.

#11制作一个程序,要求用户提供10个数字,然后告诉这些数字和平均数之和。



#12相同#11但询问您要输入多少个数字

#11 Make a program that asks for 10 numbers from the user and then tells the sum of those number and the average.

#12 Same #11 but ask how many numbers do you want to input

#13制作一个程序,询问10个数字并将其溢出到保留顺序中。使用for-loop和table。

#13 Make a program that asks 10 numbers and spills them out in the reserve order. Use for-loop and table.

#14制作一个程序,询问我们应该打印多少颗星,然后像这样打印出来。

#14 Make a program that asks how many stars should we print and then prints them like this

*********************

*********************

#15制作一个程序,询问hastag square的变量然后打印它们,例如4 x 2.

#15 Make a program that asks variable of a hastag square and then prints them for example 4 x 2.

####

####

####
####

爱你!

提前致谢!

Love you!
Thanks in advance!

推荐答案

你需要一些 var str = Console.ReadLine(); Int32.Parse( str); 或更好
Int32.TryParse(str,out int i); 以及一些计算,例如  result = i1 + i2;   usw ...输出
Console.WriteLine(

you will need some var str = Console.ReadLine();, Int32.Parse(str); or better Int32.TryParse(str, out int i); and some calculations like result = i1+i2; usw... Output it with Console.WriteLine(


" Text {i1} {i2}");
"Text {i1} {i2}");

我希望这会给你一些如何开始的想法,现在快点! ; P

I hope this gives you some ideas how to start, and now hurry up! ;P

namespace ConsoleApp
{

    public class Program
    {

        public static void Main(string[] args)
        {
            Console.WriteLine("Input your mothers age:");
            var str1 = Console.ReadLine(); //Putin some values
            Console.WriteLine("Input your age:");
            var str2 = Console.ReadLine(); //Putin some values
            if (Int32.TryParse(str1, out int motherAge)
                && Int32.TryParse(str2, out int yourAge))
            {
                //If you get here, the input is a valid int32
                //Do your calculation
                var result = motherAge - yourAge;
                Console.WriteLine(


"你的母亲是{结果}岁,当她得到你的时候!);
}
else
{
Console.WriteLine(" Invalid input!");
}

// ...

Console.ReadLine();
}
}
}
"Your mother was {result} years old, when she got You!"); } else { Console.WriteLine("Invalid input!"); } // ... Console.ReadLine(); } } }

这只是#1

问候,克里斯


这篇关于救命!家庭作业!截止日期以C#结束。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆