请帮助我使用VB.Net编写此问题的代码 [英] please help me in writing the codes for this question using VB.Net

查看:68
本文介绍了请帮助我使用VB.Net编写此问题的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VB.Net编写程序代码,在用户输入-1之前,它会不断询问学生20个成绩.该程序应显示用户输入的成绩标记的总数并计算平均值.

write the program code using VB.Net that would keep on asking for 20 grade marks of students until the user enters -1. the program should display the total of the grade marks entered by the user and calculate the average.

推荐答案

一种方法是使用InputBox设置循环以获取用户输入.

读取每个条目的输入以测试-1或将条目放入数组.

输入所有值后,执行平均值.

在读取过程中,您将需要将字符串输入转换为数字值.

这应该是足够的线索,而不会给您一个答案,所有这些要素在询问之前都应该已经涵盖在您的课程中.
One method would be to setup a loop using InputBox to grab user input.

Read the input on each entry to test for the -1 or put the entry into an array.

Once all the values have been entered perform the average.

You will need to convert string input to a numeric value as part of the reading process.

That should be enough clues without giving you the answer on a plate, all these elements should have been covered already in your course before they are asking about them.


这篇关于请帮助我使用VB.Net编写此问题的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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