Questions & Answers about Я напишу текст к среде.
Why do we use к среде instead of в среду here?
The preposition к plus the Dative case expresses a deadline, meaning "by" a certain time. If you said в среду, it would mean you will write the text on Wednesday, not necessarily that you will have it finished by then.
What case is среде and how did its ending change?
It is in the Dative case, which is always required by the preposition к. The dictionary form is среда (Wednesday). For feminine nouns ending in -а, the Dative ending changes to -е.
Could I use the imperfective future and say Я буду писать текст к среде?
No, that would sound unnatural. The verb напишу is perfective, meaning it focuses on successfully completing the action. Because a deadline (к среде) implies having a finished result ready by a specific time, you almost always need a perfective verb.
Why is the direct object текст exactly the same as its dictionary form?
As the direct object being written, текст is in the Accusative case. However, because it is a masculine inanimate noun (a thing, not a living being), its Accusative form is identical to its Nominative (dictionary) form.