Question
In a c# code, how do I display a line from a text file containing a string with a number and store the number as
In a c# code, how do I display a line from a text file containing a string with a number and store the number as a variable in the c# code, and then update the line in the text file with the data from the function.
text file format:
count 1 : 3
count 2: 1
count 3: 7
Total count: 11
function script:
var count1;
var count2;
var count3;
var total
var disp1;
var disp2;
var disp3;
var dispttl;
function choice1() {
count1 += 1;
}
function choice2() {
count2 += 1;
}
function choice3() {
count3 += 1;
}
function disp() {
string disp1 = "Count 1 : " + count1;
document.getElementById("count1").innerHTML = disp1;
string disp2 = "Count 2 : " + count2;
document.getElementById("count2").innerHTML = disp2;
string disp3 = "Count 3: " + count3;
document.getElementById("count3").innerHTML = disp3;
string dispttl = "Total Count : " + (count1 + count2 + count3);
document.getElementById("ttlcount").innerHTML = dispttl;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started