Hello, Profs. Please, I need assistance in my c# programming code most precisely on - static void
Question:
Hello, Profs.
Please, I need assistance in my c# programming code most precisely on - static void SaveJournal() and class Journal as both FileManager and entry are both underlined in red.
Here is the prompt that I am getting in both texts and screenshot:
C:\Users\USER\Desktop\cse210\cse210-projects\prove\Develop02\Program.cs(88,18): error CS0246: The type or namespace name 'Entry' could n ot be found (are you missing a using directive or an assembly reference?) [C:\Users\USER\Desktop\cse210\cse210-projects\prove\Develop02\ Develop02.csproj]
Your help would go a long way in helping me get rid of my c# coding ability and further build my confidence in programming.
Thanks and below is the code in question.
using System;
using System.Collections.Generic;
using System.IO;
class Program
{
static Journal journal = new Journal();
static void Main(string[] args)
{
while (true)
{
DisplayMenu();
string choice = Console.ReadLine();
switch (choice)
{
case "1":
AddEntry();
break;
case "2":
DeleteEntry();
break;
case "3":
DisplayEntries();
break;
case "4":
SaveJournal();
break;
case "5":
LoadJournal();
break;
case "6":
return;
}
}
}
static void DisplayMenu()
{
Console.WriteLine("1. Add entry");
Console.WriteLine("2. Delete entry");
Console.WriteLine("3. Display entries");
Console.WriteLine("4. Save journal");
Console.WriteLine("5. Load journal");
Console.WriteLine("6. Exit");
}
static void AddEntry()
{
Console.Write("Enter date (MM/DD/YYYY): ");
string date = Console.ReadLine();
Console.Write("Enter text: ");
string text = Console.ReadLine();
journal.AddEntry(date, text);
}
static void DeleteEntry()
{
Console.Write("Enter entry number to delete: ");
int index = int.Parse(Console.ReadLine());
journal.DeleteEntry(index);
}
static void DisplayEntries()
{
journal.DisplayEntries();
}
static void SaveJournal()
{
Console.Write("Enter filename: ");
string filename = Console.ReadLine();
FileManager.SaveJournal(journal, filename);
}
static void LoadJournal()
{
Console.Write("Enter filename: ");
string filename = Console.ReadLine();
journal = FileManager.LoadJournal(filename);
}
}
class Journal
{
private List
public void AddEntry(string date, string text)
{
entries.Add(new Entry(date, text));
}
public void DeleteEntry(int index)
{
entries.RemoveAt(index - 1);
}
public void DisplayEntries()
{
for (int i = 0; i < entries.Count; i++)
{
Console.WriteLine($"{i + 1}. {entries[i].Date} - {entries[i].Text}");
}
}
}
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill