Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

For school I have to make a little program that makes Ticket Id's.

(对于学校,我必须编写一个可以制作票证编号的小程序。)

One task says: "The ticket ID is the age modulo the length of the first name + the length of the last name. I've tried this:

(一个任务说:“票证ID是姓氏的长短+姓氏的长短的模数。我已经尝试过:)

TicketID = firstname + lastname;

(TicketID =名字+姓氏;)

TicketID.length() % age;

(TicketID.length()%年龄;)

I get the error that the % is not a statement.

(我收到%不是语句的错误。)

If you could help me that would be amazing.

(如果您能帮助我,那将是惊人的。)

Greets, Alex

(问候,亚历克斯)

  ask by Alexander Thomas translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
357 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to assign the result of % to some other variable

(您需要将%的结果分配给其他变量)

TicketID = firstname + lastname;

(here) = TicketID.length() % age;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...