‘There is no argument given that corresponds to the required parameter’

I just started a higher education course and one of the things we were sent off to do as independent study was to go on W3Schools and work through part of their C# tutorials. I ended up making this kind of registration console app, and I’ve run into an issue where I THINK it’s telling me that it can’t find the values from the variables in a different method.

It’s not actually going to be used for anything, but I think this might be me actually just misunderstanding how the methods work, so I thought it was probably worth coming here. I’m sorry if this is a really simple solution ;-;

The full error in VS Code was “There is no argument given that corresponds to the required parameter ‘username’ of ‘Registration.Confirm(int, int)’ (CS7036) [Ln 60, Col 13]’ and it also occurs at Ln 77, Col 17

And Here’s the code:

using System;
using System.ComponentModel;
using System.Threading;
using System.Globalization;
using System.Reflection.PortableExecutable;
using System.Reflection.Metadata.Ecma335;

namespace TestRegister
{
    public class Registration
    {
        public static void Main(string[] args)
        { 
            var today = DateTime.Today;
            var myAge = today.Year - 2008;

             

            // this is a comment. this code prints to the console
            var myName = "My Name "; // this usually has my actual name but im removing it on public forums :)
            Console.WriteLine("Hello World!");
            Console.WriteLine("This is a test program!");
            Console.WriteLine("281 plus 1412 equals:");
            Console.WriteLine(281 + 1412);
            Console.WriteLine("This test program was written by:");
            Console.WriteLine(myName);
            Console.WriteLine("And my age is:");
            Console.WriteLine(myAge);
            EnterUsername();
            /* this is the beginnning of a Multi-line comment
           and this is the end of a multi-line comment */
        } 
        public static void EnterUsername()
        {
            var maximumUserLength = 15;
            
            Console.WriteLine("Enter your Username:");
            string username = Console.ReadLine();
            if(username.Length > maximumUserLength)
            {
                Console.WriteLine("Usernames can only be up to 15 characters long. Please try again with a shorter username.");
                EnterUsername();
             }
            else;
            EnterAge();
                        
        }    
        public static void EnterAge()
        {  
            var maximumAge = 85;

            Console.WriteLine("Enter your age:");
            int age = Convert.ToInt32(Console.ReadLine());
            if(age > maximumAge)
            {
                Console.WriteLine("Sorry, you are older than our age limit.");
                EnterUsername();
            }
            else;
            Confirm();
        }   

        public static void Confirm(int username, int userAge)
        {
            
            
            Console.WriteLine("Confirm: Your chosen Username is: " + username + " and your current age is: " + userAge + ". (Y/N)");
            string ConfirmDetails = Convert.ToString(Console.ReadLine());
            if(ConfirmDetails.Contains("y"))
            {
                Console.WriteLine("Thank you for the information. You have been registered.");
            }
            else if(ConfirmDetails.Contains("n"))
                EnterUsername();
            else;
                Console.WriteLine("Invalid character.");
                Confirm();
        }
    }
}
`

I’ve been staring at this trying things from the examples on W3Schools as well as looking up the problem online but I haven’t been able to fix it after about 2 hours. The only thing I can think of doing other than coming here was to ask an AI but I’m not sure I want to start relying on that already. Thanks.

New contributor

SomeFurredNerd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật