我需要帮助拉出一个字母等级,如果我试过的声明不能得到它 [英] I Need Help Pulling A Letter Grade From And If Statement I Tried Bu Can't Get It

查看:68
本文介绍了我需要帮助拉出一个字母等级,如果我试过的声明不能得到它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧所以即时通讯试图得出并平均从用户输入的内容作为他的分数并使用if或switch语句我已经工作了几天如果你可以帮助那就不能得到它很棒。



ok so im trying to get come up with and average from what the user to puts in as his scores and use an if or switch statement i been working on this for days an can't get it if you can help that would be great.

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

namespace Problem3
{
    class Program
    {private 
        private float instructions()
        static void Main(string[] args)

        { public instructions
           
            Console.WriteLine("  Enter exam1");
            avalue = Console.ReadLine();
            examscore1 = float.Parse(avalue);

            Console.WriteLine("  Enter exam2");
            bvalue = Console.ReadLine();
            examscore2 = float.Parse(bvalue);

            Console.WriteLine("  Enter exam3");
            cvalue = Console.ReadLine();
            examscore3 = float.Parse(cvalue);


            Console.WriteLine("  Enter exam4");
            dvalue = Console.ReadLine();
            examscore4 = float.Parse(dvalue);


            Console.WriteLine("  Enter exam5");
            evalue = Console.ReadLine();
            examscore5 = float.Parse(evalue);
             
             if( score = 100,90)
           letter ='A';
     else if(score = 89,80)
           letter ='B';
     else if(score = 79,70)
           letter ='C';
     else if(score = 69,60)
           letter ='D';
      else
           grade='F';
        return letter;

            Console.WriteLine("Your average grade is!!:{0:f0}" );
            results = Console.ReadLine();   
            char.Parse(score);

            results = (examscore1 + examscore2 + examscore3 + examscore4 + examscore5) / 3;
            Console.WriteLine("Your exam Average is!!:{0:f0}", results);
            Console.Read();
        }
    }
}

推荐答案

这有很多错误很难知道从哪里开始。您似乎有很多断开连接或部分陈述。您有随机变量名称,一些未定义,一些在设置后未使用。您甚至尝试通过将它们加在一起并除以3来创建五个值的平均值!



我强烈建议您返回编程指南或学习笔记仔细研究它,这样你至少可以很好地掌握基础知识。您可能还想查看 .NET Book Zero [ ^ ],其中包含初学者的一些简单明了的例子。
There is so much wrong with this it is difficult to know where to start. You seem to have lots of disconnected or partial statements. You have random variable names, some which are not defined, some which are not used after being set. You even try to create the average of five values by adding them together and dividing by 3!

I would strongly advise you to go back to your programming guide or study notes and work through it carefully so you have at least a good grasp of the basics. You might also like to look at .NET Book Zero[^], which contains some clear and simple examples for the beginner.


这篇关于我需要帮助拉出一个字母等级,如果我试过的声明不能得到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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